Running the MCP Server Locally

The Silicofeller Quantum Studio MCP server is a Python package in mcp_server/ of the repository. It holds no data of its own: every tool calls the Quantum Studio REST API with the caller’s bearer token, so project permissions, plan checks and MCP rate limits are enforced by the backend. This page is for developers who want to run the server against a local or private backend. Users of the hosted service do not need it; see Connect Claude.

Requirements

  • Python 3.10 (the version the test suite pins).

  • The packages in mcp_server/requirements.txt: mcp==2.3.0, httpx==0.28.1, anyio==4.15.1, starlette==1.7.0 and uvicorn==0.54.0.

  • A reachable Quantum Studio backend and a token for it.

Install the server:

cd mcp_server
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

Get a token

Use one of these:

  • A personal MCP token (sfmcp_…) created on Connect Claude in the web app you are pointing at.

  • For local development only, a web-session JWT: in the browser console of the signed-in app, localStorage.getItem("qs_token"). It is treated as a web session, so web-app plan rules apply. For example, a Free account cannot save designs with it, while it can with an MCP token. A session token is also not limited by the MCP allow-list, which is why the semi_* tools work with it.

Transport modes

Mode

Command

Behaviour

stdio (default)

python -m silicofeller_mcp.server

One user. The token comes from SILICOFELLER_TOKEN (or an Authorization header if the client sends one). Use with Claude Desktop or Claude Code on the same machine.

Streamable HTTP

python -m silicofeller_mcp.server --http --port 8765

Serves /mcp on 127.0.0.1 by default (--host or HOST to change). Clients send Authorization: Bearer <token> on each request; SILICOFELLER_TOKEN is used when a request has no header.

Hosted

python -m silicofeller_mcp.server --hosted or SILICOFELLER_HOSTED=1

Multi-tenant. HTTP only, binds 0.0.0.0:$PORT (default 8765), serves /mcp and GET /health (returns {"ok": true}). Every request must carry its own Authorization header; SILICOFELLER_TOKEN is never used.

The HTTP modes run stateless, so one instance can serve many users.

Environment variables

Variable

Default

Purpose

SILICOFELLER_API_URL

https://silicofeller.com

Backend the tools call.

SILICOFELLER_APP_URL

value of SILICOFELLER_API_URL

Base of the editor_url links returned to Claude.

SILICOFELLER_TOKEN

none

Token for stdio and local HTTP use. Ignored in hosted mode.

SILICOFELLER_HOSTED

off

1, true or yes turns on hosted mode.

PORT

8765

Listening port for the HTTP modes.

SILICOFELLER_CATALOG

repository copy of component_catalog.json

Component catalog used by list_components and describe_component.

SILICOFELLER_INTROSPECTION_SECRET

none

In hosted mode, turns on OAuth resource-server mode. Must match the backend’s OAUTH_INTROSPECTION_SECRET.

SILICOFELLER_OAUTH_ISSUER

SILICOFELLER_APP_URL, else https://silicofeller.com

Authorization server advertised to clients.

SILICOFELLER_RESOURCE_URL

https://silicofeller.com/mcp

This server’s public MCP URL.

Connect a local client

claude mcp add silicofeller --env SILICOFELLER_TOKEN=<token> \
  -- /ABSOLUTE/PATH/mcp_server/.venv/bin/python -m silicofeller_mcp.server

Add --env SILICOFELLER_API_URL=http://127.0.0.1:5000 to target a local backend.

In Claude Desktop → Settings → Developer → Edit Config:

{
  "mcpServers": {
    "silicofeller": {
      "command": "/ABSOLUTE/PATH/mcp_server/.venv/bin/python",
      "args": ["-m", "silicofeller_mcp.server"],
      "cwd": "/ABSOLUTE/PATH/mcp_server",
      "env": { "SILICOFELLER_TOKEN": "<token>" }
    }
  }
}
.venv/bin/python -m silicofeller_mcp.server --http --port 8765
claude mcp add --transport http silicofeller http://127.0.0.1:8765/mcp \
  --header "Authorization: Bearer <token>"

Always pass tokens in the Authorization header. The backend rejects MCP tokens sent as a ?token= query parameter.

Demo scripts

mcp_server/demo/ contains bash scripts that run a complete local stack with no calls to silicofeller.com. They expect POSIX tools and virtual environments at backend/.venv and mcp_server/.venv, plus frontend/node_modules.

Script

What it does

start_local_demo.sh

Starts the backend on 127.0.0.1:5000 (development mode, SQLite in mcp_server/demo/.data/) and the frontend on localhost:8080, creates a 30-day session token for the seeded user collab@demo.com, and writes a git-excluded .mcp.json at the repository root that registers a stdio server named silicofeller-local for Claude Code.

start_hosted_local.sh

Runs the production layout locally: the MCP server in hosted mode with OAuth on port 8770, reachable through the frontend at http://localhost:8080/mcp. Connect with claude mcp add --transport http silicofeller-hosted http://localhost:8080/mcp, then run /mcp in Claude Code and sign in.

stop_local_demo.sh

Stops everything the two scripts started.

The password for collab@demo.com is in backend/app/startup_data.py. The frontend development server forwards /mcp to VITE_MCP_URL (default http://127.0.0.1:8770). claude.ai cannot reach localhost; test claude.ai connectors against a deployed server.

Run the tests

cd mcp_server
.venv/bin/python -m pytest -q tests      # design logic, hosted auth, error mapping, OAuth
.venv/bin/python tests/e2e_stdio.py      # real MCP client and server against a mock API
SILICOFELLER_API_URL=http://127.0.0.1:5000 SILICOFELLER_TOKEN=<jwt> \
  .venv/bin/python tests/e2e_real_backend.py   # against a local backend

Deployment

The repository includes mcp_server/Dockerfile. The production runbook (Docker Compose, nginx routing of /mcp and the OAuth secret) is in deploy/MCP_HOSTING.md.