Remote-MCP enables secure remote model context management with a simple, type-safe architecture.
Remote-MCP Server is a type-safe, bidirectional, and simple solution for remote communication and centralized management of model contexts in AI applications. It bridges the gap between local MCP servers and their remote counterparts, allowing developers to connect and manage model contexts from anywhere without waiting for future official implementations.
Remote-MCP Server introduces a type-safe client-server architecture that supports basic MCP command support, tool support, and prompt support. The server is designed to be crash-safe and includes an event subscription system for real-time notifications about resource changes, tool/prompt list updates, HTTP header support with custom headers and authentication middleware, and enhanced error handling.
Remote-MCP Server leverages a modern architecture that decouples the client from local servers. The proposed architecture below shows how remote clients connect to a centralized server hosted on a remote network, making it easier to manage model contexts across multiple locations or users.
graph TD
classDef client fill:#22c55e,stroke:#059669,stroke-width:2px,color:#ffffff
classDef gateway fill:#06b6d4,stroke:#0891b2,stroke-width:2px,color:#ffffff
classDef backend fill:#f97316,stroke:#ea580c,stroke-width:2px,color:#ffffff
classDef resource fill:#8b5cf6,stroke:#7c3aed,stroke-width:2px,color:#ffffff
linkStyle default stroke:#64748b,stroke-width:1.5px,stroke-dasharray: 5 5
%% Proposed MCP Architecture (Decoupled)
subgraph Proposed["Proposed Architecture (Remote)"]
direction LR
D[Client/Host]:::client -->|"MCP Protocol"| E["Local MCP Server (@remote-mcp/client)"]:::server
E <-->|"tRPC(HTTP)"| F["Remote MCP Server (@remote-mcp/server)"]:::backend
%% Separated Resources
F -->|"DB Access"| G1[DB]:::resource
F -->|"API Access"| G2["Web API 1"]:::resource
F -->|"API Access"| G3["Web API 2"]:::resource
end
Getting started with Remote-MCP Server involves both the client and server components. Here are steps to integrate it into your projects.
Install the necessary packages by running:
$ npm install @remote-mcp/client @trpc/client@next zod
Then, configure your MCP client settings as follows:
{
"mcpServers": {
"remote-mcp": {
"command": "npx",
"args": ["-y", "@remote-mcp/client"],
"env": {
"REMOTE_MCP_URL": "http://localhost:9512",
"HTTP_HEADER_Authorization": "Bearer <token>"
}
}
}
}
After installing @remote-mcp/server
, create a remote MCP server by following the example code:
import { MCPRouter, LogLevel } from "@remote-mcp/server";
import { createHTTPServer } from '@trpc/server/adapters/standalone';
import { z } from "zod";
// Create router instance
const mcpRouter = new MCPRouter({
logLevel: LogLevel.DEBUG,
name: "example-server",
version: "1.0.0",
capabilities: {
logging: {},
},
});
// Add example tool
mcpRouter.addTool(
"calculator",
{
description:
"Perform basic calculations. Add, subtract, multiply, divide. Invoke this every time you need to perform a calculation.",
schema: z.object({
operation: z.enum(["add", "subtract", "multiply", "divide"]),
a: z.string(),
b: z.string(),
}),
},
async (args) => {
const a = Number(args.a);
const b = Number(args.b);
let result: number;
switch (args.operation) {
case "add":
result = Number(a) + b;
break;
case "subtract":
result = a - b;
break;
case "multiply":
result = a * b;
break;
case "divide":
if (b === 0) throw new Error("Division by zero");
result = a / b;
break;
}
return {
content: [{ type: "text", text: `${result}` }],
};
},
);
const appRouter = mcpRouter.createTRPCRouter();
void createHTTPServer({
router: appRouter,
createContext: () => ({}),
}).listen(Number(process.env.PORT || 9512));
Remote-MCP Server enables real-time synchronization of data between an AI application and a remote database or API. For example, when using it with Claude Desktop, you can seamlessly access local and remote databases to fetch necessary information for tasks.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[Remote-MCP Server]
C --> D[API 1: Database Access]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
By leveraging the Remote-MCP Server, developers can dynamically integrate various tools and resources across different environments. This is particularly useful in a distributed AI development environment where teams need to share model contexts without having to replicate them locally.
Remote-MCP Client supports compatibility with major MCP clients such as Claude Desktop, Continue, and Cursor. The following table summarizes the current support status:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | Full Support | Full Support | Full Support | Full Support |
Continue | Full Support | Full Support | Not Supported | Tools Only |
Cursor | Not Currently Support | Full Support | Not Supported | Tools Only |
Remote-MCP Server is designed to be compatible with leading AI applications and tools, ensuring seamless integration. The server supports a wide range of environments and configurations, making it an indispensable tool for modern AI development.
Advanced configuration options include setting up custom timeouts, middleware integration for enhanced security, and detailed logging mechanisms. These features allow developers to fine-tune the MCP service according to specific project requirements.
{
"mcpServers": {
"[server-name]": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-[name]"],
"env": {
"API_KEY": "your-api-key"
},
"options": {
"timeout": 5000,
"middleware": [
{ "path": "/api/v2", "type": "auth" }
]
}
}
}
}
Q: How do I integrate Remote-MCP Server with my existing AI application?
Q: Are all AI applications compatible with Remote-MCP Server?
Q: Can I deploy Remote-MCP Server in a cloud environment?
Q: How do I handle security with Remote-MCP Server?
Q: Can the server support additional tools other than those mentioned?
Contributors are encouraged to join the development community. The project follows established guidelines for coding standards and documentation practices. Issues and pull requests should adhere to specific templates to ensure clarity and efficiency.
Remote-MCP Server is part of a larger ecosystem that includes other tools and resources aimed at enhancing model context management in AI applications. Check out the official repository, forums, and documentation for more details on integration and deployment best practices.
{
"mcpServers": {
"remote-mcp": {
"command": "npx",
"args": ["-y", "@remote-mcp/server"],
"env": {
"API_KEY": "your-api-key"
},
"options": {
"timeout": 5000,
"middleware": [
{ "path": "/api/v2", "type": "auth" }
]
}
}
}
}
By utilizing Remote-MCP Server, developers can significantly enhance the functionality and scalability of their AI applications, ensuring seamless integration with leading tools and resources.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods