MCP cover image
See in Github
2025-01-11

2

Github Watches

1

Github Forks

0

Github Stars

MCP

A simple example of a client and server using the Connect API.

Usage

Run an MCP server:

CONNECT_API_KEY="<your key>" SWAGGER_FILE="swagger.yaml" make server

Then run the MCP client:

make client

Modify the chat in the main function of app.py to ask different questions.

Swagger Usage

The code below is a snippet of how to register Swagger tools with Chatlas.

import chatlas
import requests
from openapi_mcp.chatlas import SwaggerTool
from openapi_mcp.connect_api import map_operations_to_tools
from openapi_mcp.swagger import (
    expand_all_references,
    transform_swagger_to_operation_dict,
)

api_url = "127.0.0.1:8000/"
openapi_dict = requests.get(f"{api_url}/swagger.json").json()

openapi_doc = expand_all_references(openapi_dict)
operations = transform_swagger_to_operation_dict(openapi_doc)
tools = map_operations_to_tools(operations)

aws_model = os.getenv("AWS_MODEL", "us.anthropic.claude-3-5-sonnet-20241022-v2:0")
aws_region = os.getenv("AWS_REGION", "us-east-1")
chat = chatlas.ChatBedrockAnthropic(model=aws_model, aws_region=aws_region)
for operation in api_operations.values():
    SwaggerTool.register_tool(
        chat,
        SwaggerTool(
            base_url=api_url,
            operation=operation,
        ),
    )

To see this in action, run a local OpenAPI-compatible server and run the Shiny application:

# Run the OpenAPI-compatible server
make ex-starwars
# Run Shiny
make shiny

Screenshot of Star Wars shiny app demo

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://jgadvisorycpa.com
  • This GPT assists in finding a top-rated business CPA - local or virtual. We account for their qualifications, experience, testimonials and reviews. Business operators provide a short description of your business, services wanted, and city or state.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • modelcontextprotocol
  • Servidores de protocolo de contexto modelo

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • Mintplex-Labs
  • La aplicación AI de escritorio todo en uno y Docker con trapo incorporado, agentes de IA, creador de agentes sin código, compatibilidad de MCP y más.

    Reviews

    2 (1)
    Avatar
    user_fvXyibfD
    2025-04-16

    I recently used mcp-server-exploration by mconflitti-pbc and it exceeded my expectations. The user-friendly interface and detailed documentation made setup a breeze. Its robust features allowed seamless server exploration and management, making it an essential tool for developers. Highly recommend checking it out: https://github.com/mconflitti-pbc/mcp-server-exploration. Great job by the creator!