Connecting MCP Clients
Once your MCP server is running (locally or on nanoHUB), you can connect it to several AI services. All clients use the nanoHUB API endpoint — no direct access to the weber proxy is needed.
Base URL for all examples:
https://nanohub.org/api/mcp/{tool}/mcp
Replace {tool} with your tool name (e.g. mcpdemo) and {token} with your nanoHUB Bearer token.
VS Code (GitHub Copilot)
Open the Command Palette:
Cmd+Shift+P(macOS) orCtrl+Shift+P(Windows/Linux)Run “MCP: Open Workspace Folder MCP Configuration”
This opens
{workspace}/.vscode/mcp.json. Add your server:
{
"servers": {
"nanohub-mcpdemo": {
"type": "http",
"url": "https://nanohub.org/api/mcp/mcpdemo/mcp",
"headers": {
"Authorization": "Bearer ${env:NANOHUB_TOKEN}"
}
}
}
}
Set the
NANOHUB_TOKENenvironment variable, or replace${env:NANOHUB_TOKEN}with your token directly.Open the Copilot chat panel and select Agent mode — your tool’s functions will appear in the tool list.
Antigravity
Click the “…” menu in the Antigravity interface
Select MCP Servers
Click Manage MCP Servers
Click View raw config
Add your server entry:
{
"mcpServers": {
"nanohub-mcpdemo": {
"serverUrl": "https://nanohub.org/api/mcp/mcpdemo/mcp",
"headers": {
"Authorization": "Bearer {token}",
"Content-Type": "application/json"
}
}
}
}
Antigravity sends a GET /mcp with Accept: text/event-stream to discover the endpoint, then POSTs all JSON-RPC messages.
OpenAI Codex
Click the gear icon to open Settings
Go to MCP Settings
Click Open MCP Settings
Click Add Server
Select Streamable HTTP as the transport type
Enter the server URL:
https://nanohub.org/api/mcp/mcpdemo/mcpFor authentication, add a Bearer token env var — set an environment variable (e.g.
NANOHUB_TOKEN) containing your token, then reference it as the Bearer value
The resulting config entry looks like:
{
"mcpServers": [
{
"name": "nanohub-mcpdemo",
"url": "https://nanohub.org/api/mcp/mcpdemo/mcp",
"headers": {
"Authorization": "Bearer ${NANOHUB_TOKEN}"
}
}
]
}
Claude Desktop
Claude Desktop only supports local stdio MCP servers. Use the nanohub_mcp_client.py bridge included in the repository, which proxies stdio to the nanoHUB HTTP API.
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"nanohub": {
"command": "python3",
"args": ["/path/to/nanohub_mcp_client.py"],
"env": {
"NANOHUB_TOKEN": "{token}",
"NANOHUB_TOOLS": "mcpdemo"
}
}
}
}
Set NANOHUB_TOOLS to a comma-separated list to expose multiple tools:
"NANOHUB_TOOLS": "mcpdemo,rappture,another_tool"
Multiple Tools
HTTP clients (VS Code, Antigravity, Codex) connect to one tool per server entry. To expose multiple nanoHUB tools, add one entry per tool:
{
"mcpServers": {
"nanohub-mcpdemo": {
"serverUrl": "https://nanohub.org/api/mcp/mcpdemo/mcp",
"headers": { "Authorization": "Bearer {token}" }
},
"nanohub-rappture": {
"serverUrl": "https://nanohub.org/api/mcp/rappture/mcp",
"headers": { "Authorization": "Bearer {token}" }
}
}
}
Local Development
When running the MCP server locally (without nanoHUB), point clients directly at your local server:
http://localhost:8000/mcp
VS Code (via MCP: Open Workspace Folder MCP Configuration):
{
"servers": {
"my-local-server": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}
Verify the server is reachable before connecting a client:
curl -s http://localhost:8000/mcp
curl -s -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'