Remote-MCP

by RemoteMCP
MIT License

Integrations

  • Supports deploying the remote MCP server on Cloudflare Workers, allowing for globally distributed MCP functionality with low latency

  • Planned integration with NestJS framework mentioned in the roadmap for enhanced server-side implementation options

  • Provides a standalone Node.js implementation option for hosting the remote MCP server

원격 MCP: 원격 모델 컨텍스트 프로토콜

원격 MCP 통신을 위한 유형 안전하고 양방향이며 간단한 솔루션으로, 모델 컨텍스트의 원격 접근과 중앙 집중식 관리를 허용합니다.

건축학

지엑스피1

내가 이걸 만든 이유 (지금)

네, 공식 MCP 로드맵에 2025년 1분기에 원격 MCP 지원이 포함된다는 것을 알고 있습니다. 하지만 저에게는 원격 접속이 시급 했고, 다른 많은 사람들도 그럴 가능성이 높습니다. 이 라이브러리는 이러한 간극을 메우기 위해 개발되었으며, 향후 공식 구현을 기다리지 않고도 로컬 MCP 클라이언트에서 원격 MCP 서버에 바로 연결할 수 있는 방법을 제공합니다.

참고: 너무 복잡하거나 어려운 내용은 원하지 않습니다. 이 방법은 지금 당장은 효과적입니다 .

시작하기

참고: 이 프로젝트는 현재 활발하게 개발 중이며 실험적인 단계로 간주됩니다. 중대한 변경 사항 및 잠재적인 문제가 발생할 수 있습니다.

클라이언트 사용

공개적으로 게시된 패키지 사용

MCP 클라이언트 설정에 다음 코드를 입력하세요. 여기서는 Claude를 예로 사용했습니다.

{ "mcpServers": { "remote-mcp": { "command": "npx", "args": ["-y", "@remote-mcp/client"], "env": { "REMOTE_MCP_URL": "http://localhost:9512", "HTTP_HEADER_Authorization": "Bearer <token>" } } } }

로컬 MCP 서버 직접 코딩

설치 요구 사항:

$ npm install @remote-mcp/client @trpc/client@next zod

그런 다음 다음과 같이 코드를 직접 작성하세요.

import { RemoteMCPClient } from "@remote-mcp/client"; const client = new RemoteMCPClient({ remoteUrl: "http://localhost:9512", onError: (method, error) => console.error(`Error in ${method}:`, error) }); void client.start();

서버 사용(원격 MCP 구현)

몇 가지 예는 examples 디렉토리에서 볼 수 있습니다.

원격 MCP 서버를 직접 코딩하세요

npm install @remote-mcp/server 실행한 후, 다음과 같이 원격 MCP 서버를 직접 설치할 수 있습니다.

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));

그러면 MCP 클라이언트에서 다음과 같은 내용을 볼 수 있습니다.

패키지

이 저장소에는 다음이 포함되어 있습니다.

  • @remote-mcp/client : 원격 구현에 연결하는 로컬 MCP 서버 역할을 하는 클라이언트 라이브러리입니다.
  • @remote-mcp/server : 원격으로 접근 가능한 MCP 서비스를 생성하기 위한 서버 라이브러리(원격 구현으로 사용됨).

로드맵

핵심 기능

  • [x] 기본 유형 안전 클라이언트/서버 통신
    • [x] 기본 MCP 명령 지원
    • [x] 기본 MCP 도구 지원
    • [x] 기본 MCP 프롬프트 지원
    • [ ] 충돌 안전 취급(WIP, 최우선 순위)
  • [ ] 완벽한 이벤트 구독 시스템
    • [ ] 리소스 변경 알림
    • [ ] 도구/프롬프트 목록 변경 알림
  • [ ] HTTP 헤더 지원
    • [x] 사용자 정의 헤더
    • [ ] 인증 미들웨어
  • [ ] 기본 오류 처리 개선
  • [ ] 기본 미들웨어 지원

프레임워크 지원

  • [ ] Nest.js 통합( @remote-mcp/nestjs )

고급 기능

  • [ ] 양방향 통신
    • [ ] 서버-클라이언트 요청
    • [ ] 서버/클라이언트 간 리소스 공유
  • [ ] 기본 모니터링 및 로깅

기여하다

기여를 환영합니다. 자세한 내용은 CONTRIBUTING.md를 참조하세요.

부인 성명

이 라이브러리는 공식 MCP 사양의 일부가 아닌 보완적 확장 기능으로, 기존 MCP 개념을 기반으로 구축되었습니다.

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 라이선스 파일을 참조하세요.

참고문헌

-
security - not tested
A
license - permissive license
-
quality - not tested

MCP(Model Context Protocol) 서비스에 대한 원격 액세스를 가능하게 하는 유형 안전 솔루션으로, 클라이언트가 공식적인 원격 지원을 기다리지 않고도 중앙 집중식 MCP 구현에 연결할 수 있습니다.

  1. Architecture
    1. Why I Made This (Now)
      1. Getting Started
        1. Client Usage
          1. Use Publicly Published Package
          2. Code Your Own Local MCP Server
        2. Server Usage (Remote MCP Implementation)
          1. Code Your Own Remote MCP Server
        3. Packages
          1. Roadmap
            1. Core Features
            2. Framework Support
            3. Advanced Features
          2. Contribute
            1. Disclaimer
              1. License
                1. References

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    A beginner-friendly Model Context Protocol (MCP) server that helps users understand MCP concepts, provides interactive examples, and lists available MCP servers. This server is designed to be a helpful companion for developers working with MCP. Also comes with a huge list of servers you can install.
                    Last updated -
                    3
                    9
                    36
                    JavaScript
                    Apache 2.0
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A Model Context Protocol (MCP) server that provides a simple sleep/wait tool, useful for adding delays between operations such as waiting between API calls or testing eventually consistent systems.
                    Last updated -
                    1
                    6
                    7
                    JavaScript
                  • -
                    security
                    -
                    license
                    -
                    quality
                    A specialized server that helps users create new Model Context Protocol (MCP) servers by providing tools and templates for scaffolding projects with various capabilities.
                    Last updated -
                    1
                    TypeScript
                  • -
                    security
                    -
                    license
                    -
                    quality
                    A Model Context Protocol (MCP) server that interacts with system APIs, allowing users to check connections, search employees, register breakfast, and update chemical information by shifts.
                    Last updated -
                    2

                  View all related MCP servers

                  ID: ov5c745xe1