-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Build the Nexus Model Context Protocol (MCP) Adapter
What?
We need to develop nexus-mcp-adapter, a service that bridges the gap between the Model Context Protocol (MCP) and the Nexus Framework's robust identity and authentication management.
This adapter will allow Nexus to act as an MCP Server, exposing user-connected data sources (like Google Drive, GitHub, Salesforce) as standardized MCP Tools and Resources that any MCP-compatible LLM (like Claude Desktop) can consume immediately.
Why?
The Model Context Protocol is rapidly becoming the industry standard for connecting AI models to external tools. It standardizes how an LLM asks for data (e.g., "Call the github_list_repos tool").
The Problem: MCP defines the context layer, but it explicitly leaves authentication out of scope. Handling multi-tenant OAuth 2.0 flows, token caching, and token refreshing is incredibly difficult for agent builders.
The Solution: Nexus already solves the hard parts of multi-tenant identity. By building this adapter, we create a massive value proposition: Plug Nexus into your MCP Agent, and instantly get secure, authenticated access to dozens of APIs without writing any auth code.
Sample Approach (The "How")
- Dynamic Tool Exposure: The adapter connects to the
nexus-gatewayand queries the available (and configured) providers for a specific user/tenant. It translates these into an MCPtools/listresponse.- Example: If a user has connected their GitHub account via Nexus, the adapter exposes an MCP tool called
nexus_github_api.
- Example: If a user has connected their GitHub account via Nexus, the adapter exposes an MCP tool called
- Tool Execution Interception: When the LLM (Client) sends a
tools/callmessage to usenexus_github_api, the MCP adapter receives it. - Transparent Authentication: The adapter uses
nexus-bridge(or the newnexus-sidecar) to securely retrieve a fresh access token for that specific user. - Proxying the Request: The adapter executes the actual API call against the provider (e.g., GitHub) using the securely retrieved token.
- Formatting the Output: The adapter takes the JSON response from the provider, formats it into an MCP-compliant result (e.g., a text or JSON content block), and returns it to the LLM.
Where to Begin
- Research MCP: Familiarize yourself with the MCP Specification (specifically the Server architecture and the Tools primitive).
- Scaffold the Project: Create a new directory
nexus-mcp-adapter.- Language Choice: While Nexus is primarily Go, the MCP ecosystem currently has the strongest tooling in TypeScript/Node.js (and Python). A TypeScript-based adapter utilizing the official
@modelcontextprotocol/sdkmight be the fastest path to market, communicating with the Gonexus-gatewayvia REST/gRPC.
- Language Choice: While Nexus is primarily Go, the MCP ecosystem currently has the strongest tooling in TypeScript/Node.js (and Python). A TypeScript-based adapter utilizing the official
- Build the Skeleton Server: Implement a basic MCP server that can start up and respond to
initializeandtools/listrequests overstdioorSSE. - Hardcode a Proof of Concept: Create a single hardcoded tool (e.g., "Get my GitHub profile"). Wire this tool to fetch a token from a local running instance of
nexus-broker/gatewayand execute the request. - Generalize: Once the POC works, abstract the logic so tools can be generated dynamically based on the OpenAPI specs of the providers connected in Nexus.