Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate MCP protocol with existing JSON-RPC 2.0 implementation #2

Open
wants to merge 1 commit into
base: rpc-worker-pool
Choose a base branch
from

Conversation

Luxcium
Copy link
Owner

@Luxcium Luxcium commented Dec 15, 2024

Add support for MCP types and integrate them with existing JSON-RPC 2.0 implementation.

  • New Files:

    • Add src/types/specs/mcp-bridge/index.ts to define MCPRequest, MCPNotification, and MCPResponse types, and implement type guards and isMCPMessage function.
    • Add src/types/specs/mcp-bridge/factories.ts to implement createMCPRequest, createMCPNotification, createMCPResponse, and createMCPErrorResponse functions.
  • Modified Files:

    • src/commands/tools/createComand.ts: Modify createRPCRequest and createRPCResponse to support MCP types.
    • src/server/API/baseRpcRequest.ts: Modify rpcRequestMethodHandler to support MCP types.
    • src/server/API/index.ts: Export new functions and types from src/types/specs/mcp-bridge/index.ts and src/types/specs/mcp-bridge/factories.ts.
    • src/server/API/RPC-serialise.ts: Modify baseRpcResponseRight to support MCP types.
    • src/server/job/asyncOnMessageWrap.ts: Modify asyncOnMessageWrap to support MCP types.
    • src/server/worker.ts: Modify worker to support MCP types.
    • src/core/RpcWorkerPool.ts: Modify RpcWorkerPool to support MCP types.
    • src/core/RpcWorkerPool-slim.ts: Modify RpcWorkerPool to support MCP types.

Add support for MCP types and integrate them with existing JSON-RPC 2.0 implementation.

* **New Files**:
  - Add `src/types/specs/mcp-bridge/index.ts` to define `MCPRequest`, `MCPNotification`, and `MCPResponse` types, and implement type guards and `isMCPMessage` function.
  - Add `src/types/specs/mcp-bridge/factories.ts` to implement `createMCPRequest`, `createMCPNotification`, `createMCPResponse`, and `createMCPErrorResponse` functions.

* **Modified Files**:
  - `src/commands/tools/createComand.ts`: Modify `createRPCRequest` and `createRPCResponse` to support MCP types.
  - `src/server/API/baseRpcRequest.ts`: Modify `rpcRequestMethodHandler` to support MCP types.
  - `src/server/API/index.ts`: Export new functions and types from `src/types/specs/mcp-bridge/index.ts` and `src/types/specs/mcp-bridge/factories.ts`.
  - `src/server/API/RPC-serialise.ts`: Modify `baseRpcResponseRight` to support MCP types.
  - `src/server/job/asyncOnMessageWrap.ts`: Modify `asyncOnMessageWrap` to support MCP types.
  - `src/server/worker.ts`: Modify worker to support MCP types.
  - `src/core/RpcWorkerPool.ts`: Modify `RpcWorkerPool` to support MCP types.
  - `src/core/RpcWorkerPool-slim.ts`: Modify `RpcWorkerPool` to support MCP types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant