FM

fulfilio/mcp-utils

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

5 stars 6 forks 품질 61 트렌드 13MIT

Python utilities to work with MCP servers

개요

A Python utility package for building Model Context Protocol (MCP) servers. mcp-utils provides utilities and helpers for building MCP-compliant servers in Python, with a focus on synchronous implementations using Flask. This package is designed for developers who want to implement MCP servers in their existing Python applications without the complexity of asynchronous code. - Basic utilities for MCP server implementation - Server-Sent Events (SSE) support - Simple decorators for MCP endpoints - Synchronous implementation - HTTP protocol support - Redis response queue - Comprehensive Pydantic models for MCP schema - Built-in validation and documentation - Flask (for web server) - Gunicorn (for production deployment) - Redis (for response queue) Here's a simple example of creating an MCP server: For production use, you can use a simple Flask app with the mcp server and support Streamable HTTP from version 2025-06-18.

README

원문 README의 일부입니다. 원문 보기.

mcp-utils

A Python utility package for building Model Context Protocol (MCP) servers.

Table of Contents

Overview

mcp-utils provides utilities and helpers for building MCP-compliant servers in Python, with a focus on synchronous implementations using Flask. This package is designed for developers who want to implement MCP servers in their existing Python applications without the complexity of asynchronous code.

Key Features

  • Basic utilities for MCP server implementation
  • Server-Sent Events (SSE) support
  • Simple decorators for MCP endpoints
  • Synchronous implementation
  • HTTP protocol support
  • Redis response queue
  • Comprehensive Pydantic models for MCP schema
  • Built-in validation and documentation

Installation

pip install mcp-utils

Requirements

  • Python 3.10+
  • Pydantic 2

Optional Dependencies

  • Flask (for web server)
  • Gunicorn (for production deployment)
  • Redis (for response queue)

Usage

Basic MCP Server

Here’s a simple example of creating an MCP server:

from mcp_utils.core import MCPServer
from mcp_utils.schema import GetPromptResult, Message, TextContent, CallToolResult

# Create a basic MCP server
mcp = MCPServer("example", "1.0")

@mcp.prompt()
def get_weather_prompt(city: str) -> GetPromptResult:
    return GetPromptResult(
        description="Weather prompt",
        messages=[
            Message(
                role="user",
                content=TextContent(
                    text=f"What is the weather like in {city}?",
                ),
            )
        ],
    )

@mcp.tool()
def get_weather(city: str) -> str:
    return "sunny"

Flask Example

For production use, you can use a simple Flask app with the mcp server and support Streamable HTTP

GitHub에서 전체 README 보기

설치

npx -y @smithery/cli install mcp-proxy --client claude
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "server-name": { "url": "http://localhost:9000/mcp" } } }