Skip to content

Commit 75e62ff

Browse files
authored
Updates for arcade new generated template (#545)
Update docs
1 parent 7ec9d58 commit 75e62ff

File tree

8 files changed

+69
-38
lines changed

8 files changed

+69
-38
lines changed

app/en/home/build-tools/call-tools-from-mcp-clients/page.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Configure your MCP clients to call tools from your MCP server.
3333

3434
## Using the `arcade configure` command
3535

36-
For popular MCP clients, you can use the `arcade configure` command to configure your MCP client to call your MCP server. This will automatically add the MCP server to your client's configuration file. By default, it will use the stdio transport.
36+
For popular MCP clients, you can use the `arcade configure` command to configure your MCP client to call your MCP server. This will automatically add the MCP server to your client's configuration file. By default, it will use the stdio transport. You must run this command from the directory of your entrypoint file.
3737

3838
<Tabs
3939
items={["Cursor IDE", "VS Code", "Claude Desktop"]}
@@ -91,15 +91,15 @@ Claude Desktop does not currently support the http transport.
9191

9292
### stdio specific configuration
9393

94-
If you are using the stdio transport, `arcade configure` will assume the entrypoint (the script that contains the `MCPApp` instance and calls `app.run()`) to your MCP server is `server.py` and will set the working directory to the root of your project. You can override this with the `--entrypoint` (or `-e`) option:
94+
If you are using the stdio transport, `arcade configure` will assume the entrypoint (the script that contains the `MCPApp` instance and calls `app.run()`) to your MCP server is `server.py` and will set the working directory to the path of your entrypoint file. You can override this with the `--entrypoint` (or `-e`) option:
9595

9696
<Callout type="info">
9797
Note that the `--entrypoint` determines only the filename of the entrypoint
9898
script, not the path to the script.
9999
</Callout>
100100
<Callout type="info">
101101
When using the stdio transport, `arcade configure` will automatically load the
102-
secrets from the `.env` file in the root of your project into the appropriate
102+
secrets from the `.env` file at the directory of your entrypoint file into the appropriate
103103
configuration file for your MCP client.
104104
</Callout>
105105

@@ -170,14 +170,14 @@ If you are using the streamable HTTP transport, `arcade configure` will assume t
170170
</Tabs.Tab>
171171
<Tabs.Tab>
172172

173-
Claude Desktop does not currently support the http transport.
173+
Claude Desktop does not currently support the http transport via JSON configuration files.
174174

175175
</Tabs.Tab>
176176
</Tabs>
177177

178178
### Other configuration options
179179

180-
If you have modified the default configuration of your MCP client, you can pass the `--config` (or `-c`) option to `arcade configure` to use your custom configuration file:
180+
If you have modified the default configuration of your MCP client, or want to use a profile/workspace specific configuration file, then you can pass the `--config` (or `-c`) option to `arcade configure` to use your custom configuration file:
181181

182182
<Tabs
183183
items={["Cursor IDE", "VS Code", "Claude Desktop"]}
@@ -250,7 +250,7 @@ When configuring your MCP client using the stdio transport, you need to ensure t
250250

251251
- Your virtual environment is located at `/path/to/your/project/.venv`
252252
- Your project is located at `/path/to/your/project`
253-
- The entrypoint to your MCP server is `server.py`
253+
- The entrypoint to your MCP server is located at `/path/to/your/server.py`
254254
- One of your tools requires the `MY_SECRET_KEY` environment variable to be set.
255255
- Your secrets are stored in the `/path/to/your/project/.env` file
256256

@@ -279,15 +279,15 @@ When configuring your MCP client using the Streamable HTTP transport, ensure the
279279

280280
- Your virtual environment is located at `/path/to/your/project/.venv`
281281
- Your MCP server is located at `/path/to/your/project/server.py`
282-
- Your secrets are stored in the `.env` file
282+
- Your secrets are stored in the `/path/to/your/project/.env` file
283283

284284
Activate the virtual environment:
285285

286286
```bash
287287
source /path/to/your/project/.venv/bin/activate
288288
```
289289

290-
run the MCP server using the http transport. The secrets will be loaded from the `.env` file:
290+
run the MCP server using the http transport. The secrets will be loaded from the `.env` file that is located at the directory of your entrypoint file:
291291

292292
```bash
293293
uv run server.py http

app/en/home/build-tools/create-a-mcp-server/page.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Steps, Tabs, Callout } from "nextra/components";
77

88
# Creating an MCP Server with Arcade
99

10-
The `arcade_mcp_server` package provides powerful ways to run MCP servers with your Arcade tools. This guide walks you through the complete process of creating a custom MCP server with Arcade.
10+
The `arcade_mcp_server` package provides powerful ways to build and run MCP servers with your Arcade tools. This guide walks you through the complete process of creating a custom MCP server with Arcade.
1111

1212
<GuideOverview>
1313
<GuideOverview.Outcomes>
@@ -49,15 +49,25 @@ In your terminal, run the following command to scaffold a new MCP Server called
4949

5050
```bash
5151
arcade new my_server
52-
cd my_server
52+
cd my_server/src/my_server
5353
```
5454

5555
<Callout type="info">
5656
If you aren't already logged into your Arcade account, you will be prompted to
5757
do so by running `arcade login` in your terminal.
5858
</Callout>
5959

60-
This generates a complete project with:
60+
This generates a Python module with the following structure:
61+
62+
```bash
63+
my_server/
64+
├── src/
65+
│ └── my_server/
66+
│ ├── __init__.py
67+
│ ├── .env.example
68+
│ └── server.py
69+
└── pyproject.toml
70+
```
6171

6272
- **server.py** Main server file with MCPApp and example tools
6373
- **pyproject.toml** Dependencies and project configuration

app/en/home/build-tools/organize-mcp-server-tools/page.mdx

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,21 @@ Learn best practices for organizing your MCP server and tools, how to import too
3333

3434
## Project Structure
3535

36-
We recommend keeping your MCP server file at the root of your project and keeping your tools in separate files in a `tools` directory like so:
36+
We recommend keeping your MCP server file and tools in separate files in a `tools` directory like so:
3737

3838
```bash
3939
my_server/
40-
├── .env
41-
├── server.py # Main MCPApp
42-
├── tools/
43-
│ ├── __init__.py
44-
│ ├── math_tools.py # @tool decorated functions
45-
│ └── text_tools.py # @tool decorated functions
46-
├── pyproject.toml
47-
└── README.md
40+
├── src/
41+
│ └── my_server/
42+
│ ├── .env
43+
│ ├── server.py # Entrypoint file with your MCPApp
44+
│ ├── tools/
45+
│ │ ├── __init__.py
46+
│ │ ├── math_tools.py # @tool decorated functions
47+
│ │ └── text_tools.py # @tool decorated functions
48+
│ ├── pyproject.toml
49+
│ └── README.md
50+
└── pyproject.toml
4851
```
4952

5053
## Defining tools
@@ -74,23 +77,30 @@ from tools.math_tools import add, multiply
7477
from tools.text_tools import capitalize_string, word_count
7578
```
7679

77-
You could also import from Arcade PyPI packages:
80+
You could also import specific tools from Arcade PyPI packages:
7881

7982
```python filename="server.py"
8083
from arcade_gmail.tools import list_emails
8184
```
8285

83-
Add imported tools explicitly to the MCP server app object like this:
86+
You can also import whole modules that contain tools like this:
87+
88+
```python filename="server.py"
89+
import arcade_reddit
90+
```
91+
92+
Add imported tools explicitly to the `MCPApp` instance like this:
8493

8594
```python filename="server.py"
8695
app.add_tool(add)
8796
app.add_tool(list_emails)
97+
app.add_tools_from_module(arcade_reddit)
8898
```
8999

90100
## Key takeaways
91101

92102
- Keep your MCP server file clean and readable by defining tools in separate files
93-
- Store your tools in a `tools` directory in your project root alongside your MCP server file
103+
- Store your tools in a `tools` directory in your project alongside your MCP server file
94104
- You can import tools from other Arcade packages and your own files
95105
- Add imported tools explicitly to the MCP server app object
96106

app/en/home/build-tools/tool-context/page.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ import { Callout, Tabs } from "nextra/components";
1818
<Callout type="notice">
1919

2020
Some authorization providers may also include additional structured user
21-
information in the `ToolContext`.
21+
information in the `Context`. You can access this information via `context.authorization.user_info`.
2222

2323
</Callout>
2424

2525
## How `Context` Works
2626

27-
When you invoke a tool that requires authorization, Arcade's Tool SDK automatically:
27+
When a tool that requires authorization is invoked, the MCP server automatically:
2828

29-
1. Creates a `Context` object
29+
1. Creates an instance of `Context`
3030
2. Passes this object to your tool
3131

3232
You can then use the `Context` object to make authenticated requests to external APIs.
@@ -48,6 +48,7 @@ await context.log.debug("Debug message")
4848
await context.log.info("Information message")
4949
await context.log.warning("Warning message")
5050
await context.log.error("Error message")
51+
await context.log.log("info", "Info message") # equivalent to await context.log.info("Info message")
5152
```
5253

5354
### Secrets Management
@@ -88,7 +89,7 @@ async def my_tool(context: Context, ...):
8889

8990
## Example Code
9091

91-
The following is an example shows how tools can access runtime features through
92+
The following is an example that shows how tools can access runtime features through
9293
`Context`, including logging, secrets, and progress reporting.
9394

9495
### Environment Variables
@@ -100,7 +101,7 @@ DATABASE_URL="postgresql://localhost/mydb"
100101

101102
<Callout type="warning">
102103

103-
For the code to work, you must define your environment variables in a `.env` file.
104+
For the code to work, you must define your environment variables in a `.env` file at the same directory as your entrypoint file.
104105

105106
</Callout>
106107

app/en/home/custom-mcp-server-quickstart/page.mdx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,22 @@ In your terminal, run the following command to scaffold a new MCP Server called
6262

6363
```bash
6464
arcade new my_server
65-
cd my_server
65+
cd my_server/src/my_server
6666
```
6767

68-
This generates a complete project with:
68+
This generates a Python module with the following structure:
6969

70-
- **server.py** Main server file with MCPApp and example tools
70+
```bash
71+
my_server/
72+
├── src/
73+
│ └── my_server/
74+
│ ├── __init__.py
75+
│ ├── .env.example
76+
│ └── server.py
77+
└── pyproject.toml
78+
```
79+
80+
- **server.py** Entrypoint file with MCPApp and example tools
7181
- **pyproject.toml** Dependencies and project configuration
7282
- **.env.example** Example `.env` file containing a secret required by one of the generated tools in `server.py`
7383

@@ -85,13 +95,13 @@ Secrets are sensitive strings like passwords, api-keys, or other tokens that gra
8595

8696
<Tabs items={["Environment Variable", "Terminal"]}>
8797
<Tabs.Tab>
88-
You can create a `.env` file in the root of your project and add your secret:
98+
You can create a `.env` file at the same directory as your entrypoint file and add your secret:
8999

90100
```env filename=".env"
91101
MY_SECRET_KEY="my-secret-value"
92102
```
93103

94-
The project includes a `.env.example` file with the secret key name and example value.
104+
The generated project includes a `.env.example` file with the secret key name and example value.
95105
You can rename it to `.env` to start using it.
96106

97107
```bash

app/en/home/deployment/on-prem-mcp/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ ARCADE_USER_ID=<your-user-id>
9292
Start your MCP server with HTTP transport:
9393

9494
```bash
95-
# Navigate to your server directory
96-
cd my_server
95+
# Navigate to your entrypoint file
96+
cd my_server/src/my_server
9797

9898
# Run with HTTP transport (default)
9999
uv run server.py

app/en/references/mcp/python/sharing/page.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ By default, your MCP server runs locally on `localhost:8000`. To share it:
2121
First, start your MCP server with HTTP transport:
2222

2323
```bash
24-
# Navigate to your server directory
25-
cd my_server
24+
# Navigate to your entrypoint file
25+
cd my_server/src/my_server
2626

2727
# Run with HTTP transport (default)
2828
uv run server.py

app/en/references/mcp/python/transports/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ app.run(transport="http", host="0.0.0.0", port=8080)
9595

9696
When running in HTTP mode, the server provides:
9797

98-
- `GET /health` - Health check endpoint
98+
- `GET /worker/health` - Health check endpoint
9999
- `GET /mcp` - SSE endpoint for MCP protocol
100100
- `GET /docs` - Swagger UI documentation (debug mode)
101101
- `GET /redoc` - ReDoc documentation (debug mode)

0 commit comments

Comments
 (0)