# PR Description
Consider this PR the result of a full pass through of this repository.
## Add helper for adding tools to an `MCPApp`
You can now add all of the tools in a module to an `MCPApp` via
`app.add_tools_from_module(...)`
## Edit what `arcade new` generates
First, I updated the backend to use hatchling.
Second, the structure generated before this PR was simple, but did not
create a proper Python module.
This hindered developers in the following ways:
1. Difficult to add the tools in your server to an evaluation suite
2. Difficult to add more than one tool to an MCPApp at a time
3. All other niceties that come with being able to import modules
```
# Before
server/
├── .env.example
├── server.py
└── pyproject.toml
```
This PR updates the structure generated such that a valid Python module
is generated:
```
# After
server/
├── pyproject.toml
└── src/
└── server/
├── __init__.py
├── .env.example
└── server.py
```
## Fix Tool Chaining
`self._ctx.server.executor.run(...)` was being called, but `MCPServer`
does not have an instance of `ToolExecutor` (and it's not intended to be
an instance anyways). I updated `Tool.call_raw` to pass the programmatic
tool call through the `MCPServer._handle_call_tool`. This means that the
programmatic tool calls now go through the same steps that a typical
tool call (initiated by the MCP client) would.
This means that **toolA**, which specifies **requirementsA**, is
permitted to call **toolB**, which specifies **requirementsB**, without
needing to explicitly declare or satisfy **requirementsB**. I believe
this is acceptable because the secrets and/or auth token associated with
**toolB's** `Context` are not exposed to **toolA**, and the secrets
and/or auth token associated with **toolA's** `Context` are not exposed
to **toolB**.
## Fix User Elicitation
1. The read & write streams were created with a maximum queue size of 0.
I increased this to 100.
2. I updated `ServerSession`'s run loop to both read messages from the
stream & process them concurrently. This enables server initiated
requests (like user elicitation and progress reporting) to be handled
while tools are being executed. Otherwise, the server initiated requests
would wait for the tool to finish executing and the tool execution would
wait for the server initiated request to finish.
3.
## Fix Progress Reporting
Progress tokens sent by the client were not being stored. Therefore
there was no way to notify a client with progress updates. I am now
storing the `progressToken`, along with other `_meta` sent from the
client, in the `ServerSession`'s `_request_meta`. I am setting
`_request_meta` whenever the `MCPServer` is handling an incoming message
from a client.
## Fix handling of server names with spaces
Before:
Server name: "The simple server name"
Tool name: whisper_secret
Name seen by client: "The_simple_server_name_WhisperSecret"
After
Server name: "The simple server name"
Tool name: whisper_secret
Name seen by client: "TheSimpleServerName_WhisperSecret"
## Add Integration Tests
The stdio integration test is much more comprehensive than the http
integration test. These tests will let me sleep a bit more at night
## Add Example MCP Servers
Example servers for sampling, user-elicitation, progress reporting,
logging, tool chaining, combining prebuilt tools with custom tools, tool
secrets, tool auth, evaluations, and more!
## Add Docker template
Added a Docker template for running an MCP server in Docker (and removed
the old docker stuff)
|
||
|---|---|---|
| .. | ||
| docker | ||
| .dockerignore | ||
| README.md | ||
| setup-docker.sh | ||
Docker Template for MCP Servers
This is a generalized Docker setup template that can be applied to any MCP server built with Arcade MCP
The Dockerfile automatically detects your package name from pyproject.toml and expects your server file at src/<package_name>/server.py.
Quick Setup
Option 1: Using the Setup Script (Recommended)
Run the setup script to automatically copy the Docker files to your MCP server:
cd examples/docker-template
./setup-docker.sh ../path/to/your-server-name
This will copy all necessary Docker files to your server directory.
Option 2: Manual Setup
Copy the docker/ directory to your MCP server:
cp -r examples/docker-template/docker your-server-name/
cp examples/docker-template/.dockerignore your-server-name/
Usage
After setup, navigate to your MCP server directory and build/run:
cd your-server-name
# Build and run with docker-compose
docker-compose -f docker/docker-compose.yml up --build
# Or build and run manually
docker build -f docker/Dockerfile -t your-server .
docker run -p 8001:8001 your-server
The package name is automatically detected from pyproject.toml
Configuration
Edit docker/docker-compose.yml to configure:
ARCADE_SERVER_PORT: Server port (default: 8001)ARCADE_SERVER_HOST: Bind host (default: 0.0.0.0)ARCADE_SERVER_TRANSPORT: Transport type (default: http)
The package name is automatically detected from pyproject.toml
What Gets Copied
The setup script copies these files to your MCP server:
docker/Dockerfile- Docker image build instructionsdocker/docker-compose.yml- Docker Compose configurationdocker/README.md- Detailed usage documentation.dockerignore- Files to exclude from Docker build
Requirements
- Docker and Docker Compose installed
- MCP server with
pyproject.tomlanduv.lock - Server file at
src/<package>/server.py