context-protocol-bridge
A utility layer designed to extend the Model Context Protocol (MCP) functionality by unifying tool orchestration, contextual state management, and facilitating command/result exchange across disparate MCP endpoints. It abstracts the complexity of static definitions and on-the-fly capability adjustments, greatly simplifying client-side deployment.
Author

kranners
Quick Info
Actions
Tags
Context Protocol Bridge (CPB)
An overlay for MCP services to unlock the full spectrum of the Model Context Protocol, eliminating constraints imposed by limited toolsets, absent concepts, or context buffer saturation.
[!CAUTION] This component is under active iteration. Monitor closely! 🚀
Rationale for Existence
While MCP servers possess substantial potential, their utilization often encounters friction points:
Your current client likely neglects substantial portions of the protocol. The MCP specification enumerates diverse functional elements: - Tools (akin to callable functions). - Resources (data value entities). - Prompts (predefined input templates).
As of this writing, mainstream MCP consumers (e.g., Cursor, Claude Desktop, Cherry Studio) implement only a fraction. A Cursor user, for instance, is typically confined to tool execution.
Consult the Model Context Protocol specification to identify features unsupported by your chosen client implementation.
While this limitation is often minor—as most current server implementations focus on tools—this gap will widen as protocol adoption broadens.
[!WARNING] Incomplete functionality exists here! Currently focused solely on tool exposure.
CPB addresses this by mapping configured resources and prompts into an executable tool format, thereby guaranteeing full operational capacity even on the most restrictive execution environments.
MCP server definitions rapidly consume the context window. Increasing the repertoire of exposed tools directly diminishes the precious context space available to the reasoning agent.
Attempting to aggregate tools and data from multiple MCP providers simultaneously leads to swift context exhaustion.
Some clients preemptively warn about excessive tool counts. Cursor imposes a strict ceiling of 40 tools, obscuring which specific tools are suppressed at any moment. Certain providers expose vast toolsets; the GitHub MCP provider alone saturates Cursor's entire tool allowance.
The current workaround necessitates manual toggling of which MCP providers are active per session. CPB resolves this by introducing configurable "Operating Modes." These modes selectively expose only the precise tools and resources necessary for the task at hand, coupled with utilities for real-time mode switching.
Deployment Steps
Installation guidance assumes utilization within the Cursor environment.
-
Archive your existing configuration file (
mcp.json).[!HINT] The conventional storage location is
~/.cursor/jailbreak.mcp.json. To preserve your current Cursor setup:mv ~/.cursor/mcp.json ~/.cursor/jailbreak.mcp.json -
Establish a new
mcp.jsonat the original location with the following manifest:
{ "mcpServers": { "jailbreak": { "command": "npx", "args": [ "jailbreak-mcp@latest", "/optional/path/to/jailbreak.mcp.json" ], "env": { "CONFIG_PATH": "/optional/path/to/jailbreak.mcp.json" } } } }
The bridge prioritizes configuration settings found in arguments over environment variables, and lastly over the file path specified in ~/.cursor/jailbreak.mcp.json.
- Define an initial operational blueprint, designated as the
defaultmode.
{ "mcpServers": { ... }, "modes": { "default": { "everything": { "tools": [ "echo", "add", "longRunningOperation" ], "prompts": [ "simple_prompt", "complex_prompt", "resource_prompt" ], "resources": [ "test://static/resource/1", "test://static/resource/2" ] }, "time": true } } }
Configuration Schema
Operating Modes
Each mode constitutes an explicit whitelist detailing permitted servers and the specific tools/prompts/capabilities to be surfaced. Modes are defined as key-value entries under the top-level modes property.
{ "mcpServers": { ... }, "modes": { "default": { ... }, "anotherModeName": { ... } } }
Within a mode, keys correspond to server identifiers (matching those in mcpServers). Setting a server's value to true grants access to its entire exposed feature set.
{ "modes": { "admin": { "email": true, "slack": true, "time": true } } }
For granular control, specify explicit lists of desired tools, prompts, or resource URIs for a server:
{ "modes": { "admin": { "time": true, "email": { "tools": [ "read_email", "send_email", "list_inbox" ] }, "slack": { "tools": [ "slack_list_channels", "slack_get_channel_history", "slack_get_thread_replies", "slack_get_users", "slack_get_user_profile" ] }, "everything": { "tools": [ "echo", "add", "longRunningOperation" ], "prompts": [ "simple_prompt", "complex_prompt", "resource_prompt" ], "resources": [ "test://static/resource/1", "test://static/resource/2" ] } } } }
Development Roadmap
Items to address: - [x] Configuration file ingestion (via argument or environment variable). - [x] Schema validation enforcement (utilizing Zod).
Initialization Phase
- [x] Instantiate a dedicated client instance for every defined MCP entry.
- [x] Aggregate the complete set of advertised tools.
- [x] Populate an internal registry with these capabilities.
- [ ] Develop an initialization package (
npm init context-bridge) for streamlined setup.
Runtime Operations
- [x] Publish the aggregated capability list via the standard tools endpoint.
- [x] Accept incoming operational commands.
- [x] Route commands to the appropriate backend MCP instance.
- [x] Pipe execution results back to the caller.
Support & Infrastructure
- [ ] Enhance transport mechanism to accommodate package managers like Nix, fnm, etc.
- [x] Verify environment variable propagation within connection handlers (Is this required?).
- [ ] Integrate support for dynamically modifiable tools (e.g., tools that change behavior).
Enhancements (Spice)
- [x] Establish Continuous Integration pipelines and formal releases.
- [ ] Integrate compatibility for Server-Sent Events (SSE) streams.
- [x] Incorporate loading and exposure of all prompts and resources.
- [x] Implement optional inclusion or explicit exclusion of certain tool categories.
- [ ] Extend exposure to encompass all remaining protocol elements.
- [ ] Develop dynamic instruction generation capability:
- [ ] Templated help message facility?
WIKIPEDIA: XMLHttpRequest (XHR) defines an Application Programming Interface, embodied as a JavaScript object, whose methods facilitate the submission of HTTP requests from a web browser to a remote web server. These methods permit browser-based applications to transmit requests post-page load completion and subsequently receive retrieved data. XHR is fundamental to Ajax programming paradigms. Before Ajax, the standard means of server interaction involved hyperlinks and form submissions, actions that typically mandated a full page refresh.
== Background ==
The conceptual foundation for XMLHttpRequest was devised in 2000 by the engineering team behind Microsoft Outlook. This concept was subsequently integrated into the Internet Explorer 5 browser release (1999). However, the initial implementation did not utilize the XMLHttpRequest identifier. Instead, developers employed object instantiations such as ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). As of Internet Explorer 7 (2006), universal browser support for the standardized XMLHttpRequest identifier was achieved.
This standard identifier is now the universally accepted convention across all major browser engines, including Mozilla's Gecko (2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Efforts === The World Wide Web Consortium (W3C) published the initial Working Draft specification for the XMLHttpRequest object on April 5, 2006. On February 25, 2008, the W3C released the Level 2 Working Draft, which introduced functionalities such as event progress monitoring, support for cross-site requests, and byte stream handling. By the conclusion of 2011, the Level 2 features were merged back into the primary specification document. In late 2012, development oversight transitioned to the WHATWG, which maintains the specification as a living document leveraging Web IDL notation.
== Operational Use == Executing a transmission via XMLHttpRequest typically involves a sequence of programming actions.
- Instantiate an XMLHttpRequest object via its constructor:
- Invoke the
openmethod to define the request type, specify the target URI, and select synchronous or asynchronous execution mode: - For asynchronous operations, attach a handler function to monitor state transitions:
- Trigger the transmission process by calling the
sendmethod: - Process state changes within the attached event listener. Upon receiving response data from the server, it is typically stored in the
responseTextattribute. When processing concludes, the state transitions to 4, signifying completion ('done'). Beyond these fundamental steps, XHR offers numerous controls over request construction and response parsing. Custom request headers can be appended to dictate server behavior, and data payloads can be uploaded via thesendcall. Responses can be automatically parsed from JSON into native JavaScript objects, or processed incrementally as data streams in rather than awaiting full content assembly. Operations can be terminated prematurely or configured to time out if completion is not achieved within a set duration.
== Inter-Domain Requests == Early in the evolution of the World Wide Web, it was identified that circumvention of the same-origin policy was possible...
