This guide covers three ways to test your OpenContext server locally.
Before testing:
- Create
config.yamlfromconfig-example.yamland enable exactly one plugin - Install dependencies:
pip install aiohttp - Start the server:
python3 scripts/local_server.py
The server runs at http://localhost:8000/mcp. Keep it running while you test.
Use the terminal to send requests directly to the server.
Ping:
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"ping"}'List tools:
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'Call a tool:
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"ckan__search_datasets","arguments":{"query":"housing","limit":3}}}'For a full test (initialize, list tools, call tool), run:
./scripts/test_streamable_http.sh- Connect via Claude Connectors (see Getting Started)
- Add a custom connector with URL:
http://localhost:8000/mcp - Enable the connector in your conversation (click "+" → Connectors → toggle on)
- Ask Claude to search your data or list available tools
Note: Localhost only works with Claude Desktop. For Claude.ai (web), use MCP Inspector or deploy first.
MCP Inspector is a web-based tool for testing MCP servers.
- With the server running, open a new terminal
- Run:
npx @modelcontextprotocol/inspector - The Inspector UI opens in your browser (typically
http://localhost:6274) - In the Inspector, select streamable-http as the transport
- Enter the URL:
http://localhost:8000/mcp - Use the Tools tab to list and call tools
Claude Desktop and Claude Code speak MCP over stdio, not HTTP. stdio_bridge.py is a small Python adapter that reads JSON-RPC from stdin, forwards it to the local HTTP server, and writes responses back to stdout — a dependency-free replacement for the Go client in client/ for cases where you just want a local stdio connection.
Start the local server first (python local_server.py from the repo root — this entry point accepts both / and /mcp), then register the bridge as an MCP server.
Claude Desktop — edit claude_desktop_config.json:
{
"mcpServers": {
"boston-opendata": {
"command": "python",
"args": [
"C:/projects/boston/OpenContext/stdio_bridge.py",
"http://localhost:8000/mcp"
]
}
}
}Claude Code — add an .mcp.json at the project root (or under .claude/):
{
"mcpServers": {
"boston-opendata": {
"command": "python",
"args": [
"C:/projects/boston/OpenContext/stdio_bridge.py",
"http://localhost:8000/mcp"
]
}
}
}The URL argument is optional — it defaults to http://localhost:8000/mcp. Pass a different URL to point at a deployed endpoint instead of the local server.
Adjust the interpreter path (e.g. C:/projects/boston/OpenContext/venv/Scripts/python.exe) if you want to pin to a specific virtualenv. stdio_bridge.py uses only Python stdlib, so no extra installs are required.
Optional checks before starting the server.
Config validation:
python3 -c "
import yaml
from core.validators import load_and_validate_config
config = load_and_validate_config('config.yaml')
print('Config valid:', config['server_name'])
"Plugin loading:
python3 -c "
import asyncio, yaml
from core.plugin_manager import PluginManager
async def t():
with open('config.yaml') as f: config = yaml.safe_load(f)
pm = PluginManager(config)
await pm.load_plugins()
print('Tools:', [t['name'] for t in pm.get_all_tools()])
await pm.shutdown()
asyncio.run(t())
"pip install pytest pytest-asyncio sqlparse
pytest
pytest tests/test_plugin_manager.py -v
pytest --cov=core --cov=pluginsTo test a deployed server, use the Lambda URL or API Gateway URL:
LAMBDA_URL="https://your-lambda-url.lambda-url.us-east-1.on.aws"
curl -X POST $LAMBDA_URL/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"ping"}'See Deployment for how to get the URL.