Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 2.7 KB

File metadata and controls

41 lines (27 loc) · 2.7 KB

Model Context Protocol (MCP) Integration

This document provides a comprehensive overview of the Model Context Protocol (MCP) and its integration into the CryptoPulse AI project.

What is MCP?

MCP (Model Context Protocol) is a standard that enables Large Language Model (LLM)-based clients to securely call servers that expose data, actions, and tools. It acts as a secure and audited bridge, giving LLMs safe access to our database, UI automation, and third-party APIs.

Key Benefits

  • Standardized Integration: MCP provides a standard way for LLM agents to communicate with various services, avoiding the need for custom-built integrations.
  • Enhanced Security: MCP is designed with security in mind, providing features like authentication, authorization, and audit logging.
  • Discoverability: MCP servers can be registered with a service like Smithery.ai, making them discoverable to other services and clients.

MCP Architecture

Our MCP architecture consists of three main components:

  • MCP Servers: These servers expose specific functionalities to the LLM agent. We have several MCP servers, including:
    • Supabase MCP Server: For database queries, Retrieval-Augmented Generation (RAG), and audit logging.
    • Playwright MCP Server: For UI automation, such as running tests and taking screenshots.
    • Stripe MCP Server: For handling payment operations.
    • Exchange MCP Server: A normalized wrapper around exchange APIs for programmatic trading.
  • MCP Clients: Our LangChain agent uses MCP clients to communicate with the MCP servers.
  • Smithery.ai: We use Smithery.ai as a registry for discovering and managing our MCP servers.

Security and Governance

Security is a top priority in our MCP implementation. We enforce the following security measures:

  • Authentication: All MCP calls are authenticated using short-lived JWTs or mTLS.
  • Authorization: We use a scope-based access control system to ensure that MCP clients only have access to the resources they need.
  • Secrets Management: We use a Key Management System (KMS) to manage all our secrets. MCP servers only have access to the secrets they need, and secrets are never exposed to the LLM agent.
  • Audit Logging: All MCP calls are logged to an immutable audit log, providing a clear record of all actions performed by the LLM agent.

Implementation

We have a detailed implementation plan for our MCP integration, which includes skeleton code for our MCP servers in both Node/TypeScript and Python/FastAPI. For more details, please refer to the following guides: