Skip to content

Feat: Implement MCP Adapter #1

Description

@goh-chunlin

Objective

Enable SilverAI to be used as an MCP Server, allowing LLM clients (Claude Desktop, Cursor, etc.) to discover and use protected tools directly.

Tasks

  • Add mcp dependency to pyproject.toml;
  • Create src/silver_ai/mcp.py;
  • Implement an MCPAdapter class that:
    • Wraps @guard functions;
    • Exposes them as MCP Tools (JSON Schema);
    • Handles the "Zero-Crash" return types for the LLM.
  • Create a server.py entry point to run the stdio server;
  • Update README with MCP configuration instructions.

Acceptance Criteria

  • A user can configure claude_desktop_config.json to point to SilverAi;
  • Claude can "see" the IndustrialRobot tools;
  • When Claude tries to execute an unsafe action, it receives the SilverAi JSON error payload.
graph TD
    subgraph Agentic Loop [Strands Agent Loop]
        direction TB
        Agent[🤖 Agent Brain]
        Model[🧠 LLM Model]
        
        %% The Thinking Loop
        Agent -->|1. Prompt| Model
        Model -->|2. Reasoning & Tool Selection| Agent
        
        %% The Action Loop (Where SilverAi Lives)
        Agent -->|3. Attempt Tool Call| Firewall{🛡️ SilverAi Guard}
        
        %% SilverAi Logic
        Firewall -->|❌ BLOCK: Unsafe State| Error[⚠️ Structured Error]
        Firewall -->|✅ PASS: Safe State| Tool[🔧 Real Tool / Hardware]
        
        %% The Feedback Loop
        Tool -->|4. Success Result| Agent
        Error -->|4. Failure Feedback| Agent
    end

    style Firewall fill:#ff4d4d,stroke:#333,stroke-width:2px,color:white
    style Agent fill:#00aaff,stroke:#333,stroke-width:2px,color:white
    style Tool fill:#00aaff,stroke:#333,stroke-width:2px,color:white
    style Model fill:#00aaff,stroke:#333,stroke-width:2px,color:white
Loading

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions