The inmydata MCP server can be deployed as a remote web service on AWS, Google Cloud, Azure, or any other hosting platform. The server accepts inmydata credentials securely via HTTP headers in the connection request.
Build the image:
docker build -t inmydata-mcp-server .Run locally:
docker run -p 8000:8000 inmydata-mcp-serverUsing docker-compose:
docker-compose up -d- Push Docker image to ECR:
aws ecr create-repository --repository-name inmydata-mcp-server
docker tag inmydata-mcp-server:latest <account-id>.dkr.ecr.<region>.amazonaws.com/inmydata-mcp-server:latest
docker push <account-id>.dkr.ecr.<region>.amazonaws.com/inmydata-mcp-server:latest- Create ECS task definition with the image
- Create ECS service with load balancer
- Configure security groups to allow port 8000
- Connect your GitHub repository
- Configure build settings:
- Build command:
docker build -t app . - Port: 8000
- Build command:
- Deploy
For serverless deployment, you'll need to adapt the server to use a Lambda handler.
# Build and deploy in one command
gcloud run deploy inmydata-mcp-server \
--source . \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--port 8000The service URL will be: https://inmydata-mcp-server-<hash>-uc.a.run.app
az containerapp up \
--name inmydata-mcp-server \
--resource-group myResourceGroup \
--location eastus \
--ingress external \
--target-port 8000 \
--source .- Create new Web Service
- Connect your Git repository
- Configure:
- Build Command:
pip install uv && uv sync - Start Command:
uv run python server_remote.py sse 8000 - Port: 8000
- Build Command:
- Deploy
- Create new project from GitHub
- Configure start command:
python server_remote.py sse 8000 - Deploy
fly launch
fly deployClients must include these headers when connecting:
x-inmydata-api-key: Your inmydata API keyx-inmydata-tenant: Your tenant namex-inmydata-calendar: Your calendar namex-inmydata-user(optional): User for chart events (default: mcp-agent)x-inmydata-session-id(optional): Session ID (default: mcp-session)
Always use HTTPS in production. Most cloud platforms provide automatic SSL certificates:
- AWS: Use Application Load Balancer with ACM certificate
- GCP Cloud Run: Automatic HTTPS
- Azure: Automatic HTTPS with Container Apps
- Render/Railway/Fly: Automatic HTTPS
If you need to add CORS support, modify server_remote.py to include CORS middleware.
Create a configuration file (client-config.json):
{
"mcpServers": {
"inmydata-remote": {
"url": "https://your-server-url.com/sse",
"headers": {
"x-inmydata-api-key": "your-api-key-here",
"x-inmydata-tenant": "your-tenant-name",
"x-inmydata-calendar": "your-calendar-name"
}
}
}
}from mcp import ClientSession, StdioServerParameters
from mcp.client.sse import sse_client
import asyncio
async def main():
headers = {
"x-inmydata-api-key": "your-api-key",
"x-inmydata-tenant": "your-tenant",
"x-inmydata-calendar": "your-calendar"
}
async with sse_client("https://your-server.com/sse", headers=headers) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
# List available tools
tools = await session.list_tools()
print(f"Available tools: {[t.name for t in tools.tools]}")
# Call a tool
result = await session.call_tool("get_financial_year", {})
print(result)
asyncio.run(main())The server supports two transport types:
-
SSE (Server-Sent Events) - Default, widely compatible
python server_remote.py sse 8000
Endpoint:
http://host:8000/sse -
Streamable HTTP - New standard, better performance
python server_remote.py streamable-http 8000
Endpoint:
http://host:8000/mcp
The FastMCP server provides health check endpoints automatically. Monitor your deployment using:
- SSE transport:
GET /sse(should return SSE stream) - HTTP transport:
GET /health(if configured)
View logs to monitor requests and errors:
- Docker:
docker logs <container-id> - AWS ECS: CloudWatch Logs
- GCP Cloud Run: Cloud Logging
- Azure: Log Analytics
For high-traffic deployments:
- Horizontal Scaling: Run multiple instances behind a load balancer
- Auto-scaling: Configure based on CPU/memory metrics
- Connection Pooling: Consider using a reverse proxy (nginx/envoy)
- Ensure the server is binding to
0.0.0.0notlocalhost - Check firewall/security group rules
- Verify headers are correctly formatted
- Check API key validity in inmydata
- The
get_answertool can take up to 60 seconds - Increase client/load balancer timeout settings
Optional environment variables for the remote server:
TRANSPORT: Transport type (sse or streamable-http)PORT: Server port (default: 8000)
- Use serverless options (Cloud Run, Lambda) for low/variable traffic
- Use containers (ECS, AKS) for consistent high traffic
- Consider cold start times for serverless deployments