From 227034ef0f774d8141e46286733f6105109c2eed Mon Sep 17 00:00:00 2001 From: Molecule AI Technical Writer Date: Thu, 14 May 2026 07:56:14 +0000 Subject: [PATCH] docs(mcp): add MCP_SERVER_PORT and MOLECULE_API_KEY to env vars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gap-fill: MCP_SERVER_PORT (default 3000) was in the MCP server README but missing from the public docs. Also added MOLECULE_API_KEY to the config examples since it's required for authentication. Added troubleshooting entry for port-in-use errors. Note: MOLECULE_URL → MOLECULE_API_URL rename is covered by PR #34. Co-Authored-By: Claude Opus 4.7 --- content/docs/mcp-server.mdx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/content/docs/mcp-server.mdx b/content/docs/mcp-server.mdx index 208beca..174c69c 100644 --- a/content/docs/mcp-server.mdx +++ b/content/docs/mcp-server.mdx @@ -25,7 +25,8 @@ npx @molecule-ai/mcp-server@1.0.0 "command": "npx", "args": ["@molecule-ai/mcp-server@1.0.0"], "env": { - "MOLECULE_URL": "http://localhost:8080" + "MOLECULE_URL": "http://localhost:8080", + "MOLECULE_API_KEY": "your-bearer-token" } } } @@ -36,10 +37,11 @@ npx @molecule-ai/mcp-server@1.0.0 **Pin the package version.** The examples above use `@1.0.0` — always specify an exact version and omit the `-y` flag. An unpinned `npx -y @molecule-ai/mcp-server` (no version) silently installs whatever npm serves on the next restart; if the package is ever compromised, it runs with your full MCP client permissions. Check [npm](https://www.npmjs.com/package/@molecule-ai/mcp-server) for the latest stable release before upgrading. -For SaaS deployments, set `MOLECULE_URL` to your tenant URL: +For SaaS deployments, set `MOLECULE_URL` to your tenant URL and add your API key: ```json -"MOLECULE_URL": "https://your-org.moleculesai.app" +"MOLECULE_URL": "https://your-org.moleculesai.app", +"MOLECULE_API_KEY": "your-bearer-token" ``` ### Verify @@ -152,6 +154,8 @@ The MCP server exposes tools across these categories: | Variable | Default | Description | |---|---|---| | `MOLECULE_URL` | `http://localhost:8080` | Platform API URL | +| `MOLECULE_API_KEY` | — | Bearer token for platform authentication | +| `MCP_SERVER_PORT` | `3000` | TCP port the MCP server listens on (HTTP/SSE transport) | ## Troubleshooting @@ -159,4 +163,5 @@ The MCP server exposes tools across these categories: |---|---| | Connection refused | Check `MOLECULE_URL` points to running platform | | 401 Unauthorized | Token expired or revoked — create a new one | +| Port already in use | Set `MCP_SERVER_PORT` to an available port if 3000 is taken | | Tools not showing | Run `npx @molecule-ai/mcp-server@1.0.0` standalone to check errors |