Sponsored by Deepsite.site

Pyro2 MCP Server

创建者
magic-foa year ago
Python-based MCP server implementation for maintaining conversation continuity across multiple projects
内容

Pyro2 MCP Server

Python-based MCP (Model Client Protocol) server implementation for maintaining conversation continuity across multiple projects. This server integrates with Supabase for data storage and provides a consistent interface for interacting with various LLM APIs.

Features

  • Project-based conversation continuity
  • Integration with Supabase for data persistence
  • Support for Claude API
  • Tool calling capability
  • Serverless API endpoints

Core Components

  1. SupabaseManager: Handles data persistence operations
  2. MCPConversationClient: Manages conversation flow
  3. API Endpoints: Provides HTTP interfaces for clients

Setup and Configuration

See documentation for setup and usage instructions.

Description

This server provides tools to assist in hardware design processes through the Model Context Protocol (MCP). It helps users get clear engineering requirements by first asking clarifying questions and then generating comprehensive engineering specifications.

The system now features:

  • Project-based conversation management
  • Conversation continuity across sessions
  • Seamless switching between multiple projects
  • State persistence via Supabase

Installation

  1. Clone this repository
  2. Install the required packages:
    pip install -r requirements.txt
    
  3. Set up a Supabase project with the following tables:
    • projects - For storing project information
    • chats - For storing chat sessions related to projects
    • messages - For storing conversation messages
  4. Create a .env file in the root directory with your API keys and configuration:
    # API Keys
    GOOGLE_API_KEY=your_gemini_api_key
    ANTHROPIC_API_KEY=your_claude_api_key
    GOOGLE_MODEL_NAME=gemini-2.0-flash-thinking-exp
    ANTHROPIC_MODEL_NAME=claude-3-7-sonnet-latest
    
    # Supabase configuration
    SUPABASE_URL=your_supabase_url
    SUPABASE_KEY=your_supabase_key
    
    # Server configuration
    PORT=3000
    PROJECT_API_PORT=3001
    

Available Tools

ask_clarifying_questions

This tool generates clarifying questions about hardware design requirements based on the user's input and conversation history.

Input parameters:

  • user_input (string): The user's query or hardware design request
  • conversation_history (array): Previous exchanges between the user and assistant

Output: A JSON string with the following structure:

{
  "response": "The generated questions about hardware design requirements",
  "is_final_requirement": false
}

generate_engineering_requirements

This tool generates formal engineering requirements for a hardware design project based on the provided conversation history.

Input parameters:

  • user_input (string): The user's query or hardware design request
  • conversation_history (array): Previous exchanges between the user and assistant

Output: A JSON string with the following structure:

{
  "response": "Comprehensive engineering requirements document",
  "is_final_requirement": true
}

Project-Based Conversation System

The system now supports maintaining conversation continuity across multiple projects:

API Endpoints

  1. Chat API: /api/chat

    • Processes chat requests for specific projects
    • Maintains conversation context between sessions
    • Parameters:
      • projectId: Unique identifier for the project
      • userInput: User's message
  2. Projects API: /api/projects

    • Manages project information
    • Endpoints:
      • GET /api/projects: List all projects
      • POST /api/projects: Create a new project

Database Schema

The system uses Supabase with the following tables:

  1. Projects table:

    • id: UUID (primary key)
    • name: String
    • description: String
    • created_at: Timestamp
    • updated_at: Timestamp
  2. Chats table:

    • id: UUID (primary key)
    • project_id: UUID (foreign key to projects.id)
    • created_at: Timestamp
    • updated_at: Timestamp
  3. Messages table:

    • id: UUID (primary key)
    • chat_id: UUID (foreign key to chats.id)
    • role: String (user/assistant)
    • content: Text
    • tool_call: JSON (optional)
    • tool_result: JSON (optional)
    • created_at: Timestamp

Running the Server

  1. Run the MCP server:

    python server.py
    
  2. Run the Chat API server:

    python api/chat.py
    
  3. Run the Projects API server:

    python api/projects.py
    

Using with Multiple Projects

The system allows users to switch between different projects while maintaining conversation context:

  1. Create projects via the Projects API
  2. Make requests to the Chat API with different project IDs
  3. The system will maintain separate conversation history for each project
  4. When returning to a previous project, the entire conversation context is preserved

Examples

Creating a new project

curl -X POST http://localhost:3001/ \
  -H "Content-Type: application/json" \
  -d '{"name": "Underwater Drone", "description": "Project for creating a seabed scanning drone"}'

Sending a chat message to a project

curl -X POST http://localhost:3000/ \
  -H "Content-Type: application/json" \
  -d '{"projectId": "project-uuid", "userInput": "수중 드론을 만들고 싶다"}'

Testing

Run the tests with:

python -m unittest discover -s tests

하드웨어 설계 MCP 서버

하드웨어 설계 프로세스를 지원하기 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다.

설명

이 서버는 모델 컨텍스트 프로토콜(MCP)을 통해 하드웨어 설계 프로세스를 지원하는 도구를 제공합니다. 먼저 명확한 질문을 통해 요구사항을 파악한 다음 종합적인 엔지니어링 사양을 생성하여 사용자의 하드웨어 설계를 돕습니다.

설치

  1. 이 저장소를 복제합니다
  2. 필요한 패키지를 설치합니다:
    pip install -r requirements.txt
    
  3. 루트 디렉토리에 Gemini API 키가 포함된 .env 파일을 생성합니다:
    GOOGLE_API_KEY=your_gemini_api_key
    

사용 가능한 도구

ask_clarifying_questions

이 도구는 사용자의 입력과 대화 기록을 기반으로 하드웨어 설계 요구사항에 대한 명확한 질문을 생성합니다.

입력 매개변수:

  • user_input (string): 사용자의 질문 또는 하드웨어 설계 요청
  • conversation_history (array): 사용자와 어시스턴트 간의 이전 대화 내용

출력: 다음 구조의 JSON 문자열:

{
  "response": "하드웨어 설계 요구사항에 대한 생성된 질문",
  "is_final_requirement": false
}

generate_engineering_requirements

이 도구는 제공된 대화 기록을 기반으로 하드웨어 설계 프로젝트에 대한 공식 엔지니어링 요구사항을 생성합니다.

입력 매개변수:

  • user_input (string): 사용자의 질문 또는 하드웨어 설계 요청
  • conversation_history (array): 사용자와 어시스턴트 간의 이전 대화 내용

출력: 다음 구조의 JSON 문자열:

{
  "response": "종합적인 엔지니어링 요구사항 문서",
  "is_final_requirement": true
}

사용 흐름

  1. 하드웨어 설계 요청으로 시작
  2. ask_clarifying_questions 도구를 사용하여 누락된 정보 식별
  3. 충분한 정보가 수집되면 generate_engineering_requirements 도구를 사용하여 공식 엔지니어링 사양 생성

서버 확장

이 서버에 더 많은 도구를 추가하려면:

  1. @mcp.tool() 데코레이터로 새 함수 정의
  2. 적절한 타입 힌트와 문서 문자열 추가(FastMCP가 도구 메타데이터를 생성하는 데 사용됨)
  3. 도구의 기능 구현
  4. 새 도구에 대한 문서로 이 README.md 업데이트

서버 실행

python server.py

클라이언트에서 서버에 연결하려면 클라이언트별 MCP 연결 지침을 따르세요.

推荐的 MCP Server
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
DeepChatYour AI Partner on Desktop
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Playwright McpPlaywright MCP server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.