{"_id":"@arunshenoy99/mcp-http-bridge","_rev":"5-746a4a9f69c9ca92d2a27150c61e5e94","name":"@arunshenoy99/mcp-http-bridge","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@arunshenoy99/mcp-http-bridge","version":"1.0.0","keywords":["mcp","model-context-protocol","stdio","http","bridge","wordpress","cursor","claude"],"author":{"name":"Arun Shenoy","email":"devarunshenoy99@gmail.com"},"license":"MIT","_id":"@arunshenoy99/mcp-http-bridge@1.0.0","maintainers":[{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"}],"homepage":"https://github.com/arunshenoy99/mcp-http-bridge#readme","bugs":{"url":"https://github.com/arunshenoy99/mcp-http-bridge/issues"},"bin":{"mcp-http-bridge":"bin/mcp-http-bridge.mjs"},"dist":{"shasum":"9f261a803554ceedce34c25c874bee240ebcb020","tarball":"https://registry.npmjs.org/@arunshenoy99/mcp-http-bridge/-/mcp-http-bridge-1.0.0.tgz","fileCount":4,"integrity":"sha512-rDIO/rMQWrvfJuArAaNBKT8NtoCz2NQiEOP0J0xv4Xbe8aHFfbpJbnirbO83DvO9zhgLd7opJ0k8Pz5f9rzVMA==","signatures":[{"sig":"MEUCICy3Dg5hp16J34hiPacbQ+qhXsh/NjKJeOJWjDuKRzq5AiEAja7j/WqKDC1LZhX/qe5Syw5ZhX0rzcueA8huRdBcdT8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11858},"main":"bin/mcp-http-bridge.mjs","type":"module","engines":{"node":">=18.0.0"},"scripts":{"start":"node bin/mcp-http-bridge.mjs"},"_npmUser":{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"},"repository":{"url":"git+https://github.com/arunshenoy99/mcp-http-bridge.git","type":"git"},"_npmVersion":"10.9.0","description":"A generic STDIO-to-HTTP bridge for Model Context Protocol (MCP) servers. Connects STDIO-based MCP clients to HTTP-based MCP endpoints.","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-http-bridge_1.0.0_1764219071108_0.7042991789393165","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@arunshenoy99/mcp-http-bridge","version":"1.0.1","keywords":["mcp","model-context-protocol","stdio","http","bridge","wordpress","cursor","claude"],"author":{"name":"Arun Shenoy","email":"devarunshenoy99@gmail.com"},"license":"MIT","_id":"@arunshenoy99/mcp-http-bridge@1.0.1","maintainers":[{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"}],"homepage":"https://github.com/arunshenoy99/mcp-http-bridge#readme","bugs":{"url":"https://github.com/arunshenoy99/mcp-http-bridge/issues"},"bin":{"mcp-http-bridge":"bin/mcp-http-bridge.mjs"},"dist":{"shasum":"762554d02bdcf1c903871e29b3f46ff388562f4b","tarball":"https://registry.npmjs.org/@arunshenoy99/mcp-http-bridge/-/mcp-http-bridge-1.0.1.tgz","fileCount":4,"integrity":"sha512-17wTZ8w555UhE2GK5J8iuurj8sWRLBZblY0TOJoV4t14YSzRP1/bZYJ9QqmZb+8zSK2Os/PTxcKZAx+EU8UE0g==","signatures":[{"sig":"MEUCIQCfIiav544JqCpA8HfnKr34WMHQZUZ01ODqRHFr5rWS1wIgKxDXn1K+x25BG7tWG2SztcFt5lIv0QLv83pOxYmCpoc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":12481},"main":"bin/mcp-http-bridge.mjs","type":"module","engines":{"node":">=18.0.0"},"gitHead":"97629392305231a94b37c1e9a0f7f752dc0f4a23","scripts":{"start":"node bin/mcp-http-bridge.mjs"},"_npmUser":{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"},"repository":{"url":"git+https://github.com/arunshenoy99/mcp-http-bridge.git","type":"git"},"_npmVersion":"10.9.0","description":"A generic STDIO-to-HTTP bridge for Model Context Protocol (MCP) servers. Connects STDIO-based MCP clients to HTTP-based MCP endpoints.","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-http-bridge_1.0.1_1764220066601_0.00178010414007157","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@arunshenoy99/mcp-http-bridge","version":"1.0.2","keywords":["mcp","model-context-protocol","stdio","http","bridge","wordpress","cursor","claude"],"author":{"name":"Arun Shenoy","email":"devarunshenoy99@gmail.com"},"license":"MIT","_id":"@arunshenoy99/mcp-http-bridge@1.0.2","maintainers":[{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"}],"homepage":"https://github.com/arunshenoy99/mcp-http-bridge#readme","bugs":{"url":"https://github.com/arunshenoy99/mcp-http-bridge/issues"},"bin":{"mcp-http-bridge":"bin/mcp-http-bridge.mjs"},"dist":{"shasum":"defa1ecec7b1e9b31f000f532d8f7e327b70be9f","tarball":"https://registry.npmjs.org/@arunshenoy99/mcp-http-bridge/-/mcp-http-bridge-1.0.2.tgz","fileCount":4,"integrity":"sha512-1o68C6/ASKLmbIpwdOPIlw+MFl2mWbv6QStK7aghoY0QptwbWHq/j4lSMaAkjivUM+y0bxQ3egIYPvBWB7zy3Q==","signatures":[{"sig":"MEUCIDKrzeHhucW6tZDmADopWOLzocokeztZEqjZspzITbT+AiEAk7MB0i0fpe8SguhXecVgoIDNOU5IbsZ2uV2OkSxQyac=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arunshenoy99%2fmcp-http-bridge@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12485},"main":"bin/mcp-http-bridge.mjs","type":"module","engines":{"node":">=18.0.0"},"gitHead":"0bd0673d13dd9beb47aa1c615f8f5fe9d4bfd864","scripts":{"start":"node bin/mcp-http-bridge.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bc896e75-afb9-45af-8906-bd0eff04a45b"}},"repository":{"url":"git+https://github.com/arunshenoy99/mcp-http-bridge.git","type":"git"},"_npmVersion":"11.6.4","description":"A generic STDIO-to-HTTP bridge for Model Context Protocol (MCP) servers. Connects STDIO-based MCP clients to HTTP-based MCP endpoints.","directories":{},"_nodeVersion":"20.19.5","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-http-bridge_1.0.2_1764220946913_0.37603265660629237","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@arunshenoy99/mcp-http-bridge","version":"1.0.3","keywords":["mcp","model-context-protocol","stdio","http","bridge","wordpress","cursor","claude"],"author":{"name":"Arun Shenoy","email":"devarunshenoy99@gmail.com"},"license":"MIT","_id":"@arunshenoy99/mcp-http-bridge@1.0.3","maintainers":[{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"}],"homepage":"https://github.com/arunshenoy99/mcp-http-bridge#readme","bugs":{"url":"https://github.com/arunshenoy99/mcp-http-bridge/issues"},"bin":{"mcp-http-bridge":"bin/mcp-http-bridge.mjs"},"dist":{"shasum":"bb61bb4fb402983055ba0441e31fc030230478e9","tarball":"https://registry.npmjs.org/@arunshenoy99/mcp-http-bridge/-/mcp-http-bridge-1.0.3.tgz","fileCount":4,"integrity":"sha512-QVMOTuJks/H65Va5lw90zEJowy3GB5VCNwZRykMdSi9OJ8QogvY5DowjLjb7Bzg9mqnWmh97CJKnCPu7qI+fsg==","signatures":[{"sig":"MEUCIQCDOZNxpNc2MUeNf9xuYgatkdT0Kcm94LVoQFTf2T0eMwIgEh7zL5lGRhxpLVOjztnFMMpQ2S3pHBPCAnScotgyEqU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arunshenoy99%2fmcp-http-bridge@1.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":12509},"main":"bin/mcp-http-bridge.mjs","type":"module","engines":{"node":">=18.0.0"},"gitHead":"aa512cf640ce49de358fa7d078612dd02edae8c6","scripts":{"start":"node bin/mcp-http-bridge.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bc896e75-afb9-45af-8906-bd0eff04a45b"}},"repository":{"url":"git+https://github.com/arunshenoy99/mcp-http-bridge.git","type":"git"},"_npmVersion":"11.6.4","description":"A generic STDIO-to-HTTP bridge for Model Context Protocol (MCP) servers. Connects STDIO-based MCP clients to HTTP-based MCP endpoints.","directories":{},"_nodeVersion":"20.19.5","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mcp-http-bridge_1.0.3_1764221095754_0.6062114365226818","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@arunshenoy99/mcp-http-bridge","version":"1.1.0","description":"A production-ready STDIO-to-HTTP bridge for Model Context Protocol (MCP) servers with automatic JWT authentication and session management. Connects STDIO-based MCP clients to HTTP-based MCP endpoints.","type":"module","main":"bin/mcp-http-bridge.mjs","bin":{"mcp-http-bridge":"bin/mcp-http-bridge.mjs"},"scripts":{"start":"node bin/mcp-http-bridge.mjs"},"keywords":["mcp","model-context-protocol","stdio","http","bridge","wordpress","cursor","claude"],"author":{"name":"Arun Shenoy","email":"devarunshenoy99@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/arunshenoy99/mcp-http-bridge.git"},"bugs":{"url":"https://github.com/arunshenoy99/mcp-http-bridge/issues"},"homepage":"https://github.com/arunshenoy99/mcp-http-bridge#readme","engines":{"node":">=18.0.0"},"gitHead":"8f4b710f0d679b85fa8c0ba86f83f2c55c38984f","_id":"@arunshenoy99/mcp-http-bridge@1.1.0","_nodeVersion":"20.19.6","_npmVersion":"11.7.0","dist":{"integrity":"sha512-Spxd82J8pJR12veWi/wHWXx9SnZfze+AKDsdAHAfSbFfYDJORGfqOC9kM8rDlmej+rNZTejdQbAPCJhxmMnslg==","shasum":"e91cea29f889fcbc3a099cb1b6b94bf48baf9272","tarball":"https://registry.npmjs.org/@arunshenoy99/mcp-http-bridge/-/mcp-http-bridge-1.1.0.tgz","fileCount":4,"unpackedSize":23232,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@arunshenoy99%2fmcp-http-bridge@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDzk5ByHzmY8mbaSIcgv6JItd0niiZ37SVi/tcEqADOCgIgFJVi8gW3Z0qTZVX26Tr3HN4oxSfnBVL6Fszx72y6eoM="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bc896e75-afb9-45af-8906-bd0eff04a45b"}},"directories":{},"maintainers":[{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-http-bridge_1.1.0_1768980295492_0.7025848329703659"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-27T04:51:10.982Z","modified":"2026-01-21T07:24:55.954Z","1.0.0":"2025-11-27T04:51:11.319Z","1.0.1":"2025-11-27T05:07:46.798Z","1.0.2":"2025-11-27T05:22:27.096Z","1.0.3":"2025-11-27T05:24:55.928Z","1.1.0":"2026-01-21T07:24:55.652Z"},"bugs":{"url":"https://github.com/arunshenoy99/mcp-http-bridge/issues"},"author":{"name":"Arun Shenoy","email":"devarunshenoy99@gmail.com"},"license":"MIT","homepage":"https://github.com/arunshenoy99/mcp-http-bridge#readme","keywords":["mcp","model-context-protocol","stdio","http","bridge","wordpress","cursor","claude"],"repository":{"type":"git","url":"git+https://github.com/arunshenoy99/mcp-http-bridge.git"},"description":"A production-ready STDIO-to-HTTP bridge for Model Context Protocol (MCP) servers with automatic JWT authentication and session management. Connects STDIO-based MCP clients to HTTP-based MCP endpoints.","maintainers":[{"name":"arunshenoy99","email":"devarunshenoy99@gmail.com"}],"readme":"# MCP HTTP Bridge\n\nA production-ready STDIO-to-HTTP bridge for [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) servers with automatic JWT authentication and session management. This tool connects STDIO-based MCP clients (like Cursor, Claude Desktop) to HTTP-based MCP server endpoints.\n\n## Quick Start\n\nFor WordPress MCP servers with JWT + Session ID authentication:\n\n```json\n{\n  \"mcpServers\": {\n    \"wordpress\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://your-site.com/wp-json/mcp\",\n        \"MCP_BEARER_TOKEN\": \"your-jwt-token-here\"\n      }\n    }\n  }\n}\n```\n\nThat's it! The bridge automatically handles JWT authentication and session management.\n\n## Installation\n\n```bash\nnpm install -g @arunshenoy99/mcp-http-bridge\n```\n\nOr use directly with npx:\n\n```bash\nnpx @arunshenoy99/mcp-http-bridge\n```\n\n## Features\n\n- Bridges STDIO-based MCP clients to HTTP endpoints\n- **Automatic JWT Bearer token authentication** via `MCP_BEARER_TOKEN`\n- **Automatic session ID management** - extracts from initialize, includes in subsequent requests\n- **Automatic session re-initialization** on expiration (404 errors)\n- Supports custom headers for additional authentication/configuration\n- Works with both HTTP and HTTPS endpoints\n- Debug mode for troubleshooting\n- Zero dependencies - uses only Node.js built-ins\n\n## Configuration\n\nConfiguration is done via environment variables:\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `MCP_ENDPOINT` | Yes | The HTTP(S) endpoint URL for the MCP server |\n| `MCP_BEARER_TOKEN` | No | JWT Bearer token for authentication (auto-added as `Authorization: Bearer <token>`) |\n| `MCP_JWT_TOKEN` | No | Alias for `MCP_BEARER_TOKEN` |\n| `CUSTOM_HEADERS` | No | Additional custom headers to include in all requests |\n| `MCP_DEBUG` | No | Set to `\"true\"` to enable debug logging |\n\n### Custom Headers\n\nThe `CUSTOM_HEADERS` environment variable supports two formats:\n\n#### JSON Format (Recommended)\n\n```bash\nCUSTOM_HEADERS='{\"Authorization\": \"Bearer token123\", \"X-API-Key\": \"mykey\"}'\n```\n\n#### Comma-Separated Format\n\n```bash\nCUSTOM_HEADERS=\"Authorization:Bearer token123,X-API-Key:mykey\"\n```\n\n## Usage with Cursor\n\nAdd to your Cursor MCP settings (`~/.cursor/mcp.json`):\n\n### WordPress with JWT + Automatic Session Management (Recommended)\n\n```json\n{\n  \"mcpServers\": {\n    \"wordpress\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://your-site.com/wp-json/mcp\",\n        \"MCP_BEARER_TOKEN\": \"your-jwt-token-here\"\n      }\n    }\n  }\n}\n```\n\nThe bridge will automatically:\n- Send JWT token in `Authorization: Bearer` header\n- Extract session ID from initialize response\n- Include session ID in all subsequent requests\n- Re-initialize on session expiration\n\n### With Custom Headers (Legacy)\n\n```json\n{\n  \"mcpServers\": {\n    \"my-wordpress\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://my-site.com/wp-json/mcp\",\n        \"CUSTOM_HEADERS\": \"{\\\"Authorization\\\": \\\"Bearer your-token\\\"}\"\n      }\n    }\n  }\n}\n```\n\n## Usage with Claude Desktop\n\nAdd to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):\n\n```json\n{\n  \"mcpServers\": {\n    \"my-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://api.example.com/mcp\",\n        \"CUSTOM_HEADERS\": \"{\\\"Authorization\\\": \\\"Bearer your-token\\\"}\"\n      }\n    }\n  }\n}\n```\n\n## Examples\n\n### WordPress with JWT Authentication (Automatic Session Management)\n\n```json\n{\n  \"mcpServers\": {\n    \"wordpress\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://your-site.com/wp-json/mcp\",\n        \"MCP_BEARER_TOKEN\": \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\"\n      }\n    }\n  }\n}\n```\n\nThis configuration automatically handles:\n- JWT authentication via `Authorization: Bearer` header\n- Session ID extraction from initialize response\n- Session ID inclusion in all subsequent requests\n- Session re-initialization on expiration\n\n### With Basic Authentication\n\n```json\n{\n  \"mcpServers\": {\n    \"my-api\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://api.example.com/mcp\",\n        \"CUSTOM_HEADERS\": \"{\\\"Authorization\\\": \\\"Basic dXNlcm5hbWU6cGFzc3dvcmQ=\\\"}\"\n      }\n    }\n  }\n}\n```\n\n### With Debug Mode\n\n```json\n{\n  \"mcpServers\": {\n    \"debug-server\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@arunshenoy99/mcp-http-bridge\"],\n      \"env\": {\n        \"MCP_ENDPOINT\": \"https://api.example.com/mcp\",\n        \"MCP_DEBUG\": \"true\"\n      }\n    }\n  }\n}\n```\n\n## How It Works\n\n```\n┌─────────────┐      STDIO       ┌──────────────────┐      HTTP       ┌─────────────┐\n│   Cursor    │ ◄──────────────► │  MCP HTTP Bridge │ ◄─────────────► │  MCP Server │\n│   Claude    │   JSON-RPC       │                  │   JSON-RPC      │   (HTTP)    │\n└─────────────┘                  └──────────────────┘                 └─────────────┘\n```\n\n1. MCP clients (Cursor, Claude) communicate via STDIO using JSON-RPC\n2. The bridge reads JSON-RPC messages from stdin\n3. Forwards them as HTTP POST requests to the configured endpoint\n4. Returns the HTTP response back via stdout\n\n### Session Management Flow\n\nWhen using `MCP_BEARER_TOKEN`:\n\n1. **Initialize Request:**\n   - Bridge sends `initialize` with `Authorization: Bearer <JWT>` header\n   - Server responds with `Mcp-Session-Id` in response headers\n   - Bridge extracts and stores the session ID\n\n2. **Subsequent Requests:**\n   - Bridge includes both `Authorization: Bearer <JWT>` and `Mcp-Session-Id` headers\n   - Both are required by the MCP server\n\n3. **Session Expiration:**\n   - If server returns 404 (session expired), bridge automatically:\n     - Clears stored session ID\n     - Sends new `initialize` request\n     - Retries the original request\n\n## Troubleshooting\n\n### Enable Debug Mode\n\nSet `MCP_DEBUG=true` to see detailed logs in stderr:\n\n```bash\nMCP_ENDPOINT=\"https://example.com/mcp\" MCP_DEBUG=true npx @arunshenoy99/mcp-http-bridge\n```\n\n### Common Issues\n\n1. **\"MCP_ENDPOINT environment variable is required\"**\n   - Make sure you've set the `MCP_ENDPOINT` environment variable\n\n2. **Connection refused**\n   - Verify the endpoint URL is correct and the server is running\n   - Check if you need to use HTTP vs HTTPS\n\n3. **Authentication errors**\n   - Verify your JWT token is valid and not expired\n   - Check if `MCP_BEARER_TOKEN` is set correctly\n   - Verify custom headers are correctly formatted (if using `CUSTOM_HEADERS`)\n\n4. **Session ID errors**\n   - The bridge automatically handles session IDs when using `MCP_BEARER_TOKEN`\n   - If you see \"Missing Mcp-Session-Id header\" errors, ensure you're using `MCP_BEARER_TOKEN` (not just `CUSTOM_HEADERS`)\n   - Check debug logs to see if session ID was extracted from initialize response\n\n## License\n\nMIT\n\n","readmeFilename":"README.md"}