Documentation
The definitive technical guide to testing, diagnosing, and deploying Model Context Protocol (MCP) servers locally and in production.
What is MCPHub?
MCPHub is built specifically to bridge the gap between building an MCP server and actually deploying it with confidence. It gives you the tools to introspect requests, check server latencies, and simulate real-world LLM calls via a Playground.
If you are building tools for LLMs, you need a way to test them exactly as an LLM would execute them. Our UI provides a fully typed, real-time interface to list tools, compile prompts, and observe JSON-RPC streams.
The Postman-like Client
The Playground is your primary workspace. Think of it as Postman, but specifically tailored to MCP JSON-RPC endpoints instead of REST.
- Connecting: You can spin up any local command (e.g.,
node index.js) or connect to an SSE HTTP endpoint. The Playground will instantly negotiate the protocol version and fetch server capabilities. - Tool Execution: Our UI automatically generates forms based on the JSON Schema of your tools. Provide the arguments, hit "Run", and view the raw JSON-RPC response instantly. No more writing manual curl commands.
- Protocol Inspector: Every single payload going over the wire is captured in the Inspector. You can filter by direction, check latency (P50/P99), and instantly spot syntax errors or malformed tool definitions.
Handling Credentials
Many popular MCP servers (like GitHub, Slack, or Postgres) require API keys, OAuth tokens, or database connection strings. Here is how you securely pass them into the Playground.
GitHub Server (Via mcp-proxy)
Since GitHub runs locally via stdio and MCPHub is a web app, you must wrap it in an SSE server using mcp-proxy. Generate a PAT with repo permissions, then run this in a terminal:
GITHUB_PERSONAL_ACCESS_TOKEN="ghp_xxx" npx -y mcp-proxy@latest --shell -- npx -y @modelcontextprotocol/server-github
Slack Server
Obtain a Bot User OAuth Token from your Slack App dashboard. Ensure the app is installed to your workspace.
SLACK_BOT_TOKEN=xoxb-xxx node build/index.js
Postgres Server
Use a standard connection string for the database server.
DATABASE_URL=postgres://user:pass@localhost:5432/db npx @server/postgres
Google Drive Server
Requires a Service Account JSON key or OAuth consent screen setup depending on the implementation.
GOOGLE_APPLICATION_CREDENTIALS=./key.json node index.js
Pro Tip: When using the Playground's Connect Form, you can add environment variables directly in the "Env Vars" section. These are injected safely before spawning the local process.
Adding Custom Servers
Building a custom MCP Server is straightforward using the official SDKs (TypeScript and Python).
Once built, you can test it directly in MCPHub by selecting Command (Stdio) in the connection form and providing the path to your server.
// Example Python Command Command: python Arguments: -m my_mcp_server Environment: API_KEY=xxx
If your server uses HTTP/SSSE, ensure CORS is enabled and point the Playground to the correct /sse endpoint.
CLI Tools & Automation
While the UI is perfect for human testing, you need CLI tools for CI/CD pipelines. The official MCP organization provides a powerful inspector CLI.
# Run the official MCP Inspector npx @modelcontextprotocol/inspector node path/to/server/index.js
This command launches a local process and opens a web interface that allows you to inspect messages and execute tools directly. It's the command-line equivalent of the Playground you see here.
If you are creating automated tests, consider using the @modelcontextprotocol/sdk in your test runner (e.g., Jest or PyTest) to spawn a client instance and assert against your server's responses programmatically.