MCP Local Development
Set up and run the DMTR MCP server locally for development.
Overview
Develop and test the DMTR MCP server locally before deploying. Local development uses stdio transport; your MCP client spawns the server process and communicates via stdin/stdout. Use sandbox API keys to avoid affecting production data.
Prerequisites
- Node.js 18+ or Python 3.10+ (depending on server runtime)
- DMTR sandbox API key
- MCP client (Claude Desktop, Cursor, or custom)
- Git (to clone and build from source if needed)
Setup
Clone the DMTR MCP server repo (or install from npm/pip). Install dependencies. Create a .env file with DMTR_API_KEY=your_sandbox_key. Optionally set DMTR_API_URL for a custom API endpoint. Run npm install or pip install -e . for editable installs.
Running locally
Run the server with npx /mcp-server or dmtr-mcp-server (Python). The server reads from stdin and writes to stdout; it does not start an HTTP server by default. Configure your MCP client to use this command. For HTTP testing, use the --transport http flag (if supported) and connect to the specified port.
Testing
Use the MCP inspector or a test client to invoke tools and fetch resources. Verify query-registry returns data, evaluate-transfer returns feasibility, and resources return valid JSON. Use sandbox data to avoid side effects. Add integration tests that spawn the server and assert on tool outputs.
Debugging
Enable debug logging with DEBUG=dmtr-mcp or LOG_LEVEL=debug. Logs go to stderr. Use breakpoints in your IDE by attaching to the server process. For HTTP transport, use curl or Postman to hit tool endpoints directly. Check DMTR API responses for 4xx/5xx errors.