Cover image
Try Now
2025-03-05

Una biblioteca de componentes XIRCUITS para definir servidores MCP.

3 years

Works with Finder

0

Github Watches

1

Github Forks

0

Github Stars

Xircuits MCP Component Library

A Xircuits component library for implementing Model Context Protocol (MCP) servers. This library provides components that make it easy to create, configure, and run MCP servers using the Xircuits visual programming interface.

What is Model Context Protocol (MCP)?

The Model Context Protocol (MCP) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions. MCP servers can:

  • Expose data through Resources (think of these sort of like GET endpoints; they are used to load information into the LLM's context)
  • Provide functionality through Tools (sort of like POST endpoints; they are used to execute code or otherwise produce a side effect)
  • Define interaction patterns through Prompts (reusable templates for LLM interactions)
  • And more!

Prerequisites

  • Python 3.8 or higher
  • Xircuits
  • MCP Python SDK

Installation

To use this component library, ensure you have Xircuits installed, then simply run:

xircuits install https://github.com/xpressai/xai-mcp

Alternatively, you may manually copy the directory / clone or submodule the repository to your working Xircuits project directory then install the packages using:

pip install -r requirements.txt

Components

This library provides components for implementing MCP servers, organized into several categories:

Server Setup Components

  • MCPCreateServer: Creates a FastMCP server instance with the specified name and optional dependencies.
  • MCPRunServer: Starts the MCP server and keeps it running until interrupted.

Start Node Components

These components act as entry points for defining MCP server capabilities. They can be dragged onto the canvas to implement responses to events:

  • MCPDefineTool (Royal Blue): Defines a tool for the MCP server, allowing LLMs to perform actions and computations.
  • MCPDefineResource (Lime Green): Defines a resource for the MCP server, allowing LLMs to access data through URI patterns.
  • MCPDefinePrompt (Dark Orchid): Defines a prompt template for the MCP server, providing reusable interaction patterns for LLMs.
  • MCPServerOnStart (Dark Orange): Defines code to execute when the MCP server starts.
  • MCPServerOnShutdown (Firebrick): Defines code to execute when the MCP server shuts down.

Result Setting Components

These components are used within the body of start nodes to set the results of tool, resource, or prompt executions:

  • MCPSetToolResult (Royal Blue): Sets the result of a tool execution.
  • MCPSetResourceResult (Lime Green): Sets the result of a resource execution.
  • MCPSetPromptResult (Dark Orchid): Sets the result of a prompt execution.

Utility Components

  • MCPCreateImage: Creates an Image object for use with MCP tools and resources.
  • MCPGetArgument: Gets an argument from the args dictionary.
  • MCPReportProgress: Reports progress for a long-running operation.
  • MCPReadResource: Reads a resource from the MCP server.
  • MCPCreateUserMessage: Creates a user message for use in prompts.
  • MCPCreateAssistantMessage: Creates an assistant message for use in prompts.
  • MCPCreateMessageList: Creates a list of messages for use in prompts.

Usage Example

Here's an example of how to use this component library to create an MCP server:

  1. Create a new Xircuits workflow
  2. Add an MCPCreateServer component to create a server instance
  3. Add MCPDefineTool, MCPDefineResource, and MCPDefinePrompt start nodes to define the server's capabilities
  4. For each start node, connect components to implement the logic for the tool, resource, or prompt
  5. Use MCPSetToolResult, MCPSetResourceResult, or MCPSetPromptResult to set the results
  6. Optionally, add MCPServerOnStart and MCPServerOnShutdown start nodes to define server lifecycle behavior
  7. Add an MCPRunServer component to start the server

Example: Creating a Calculator Tool

  1. Drag an MCPDefineTool start node onto the canvas
  2. Set its name to "add" and description to "Add two numbers"
  3. Connect an MCPGetArgument component to get the "a" argument
  4. Connect another MCPGetArgument component to get the "b" argument
  5. Connect a component that adds the two numbers
  6. Connect an MCPSetToolResult component to set the result

Example: Server Lifecycle Management

  1. Drag an MCPServerOnStart start node onto the canvas
  2. Connect components to initialize resources, load data, or perform other startup tasks
  3. Drag an MCPServerOnShutdown start node onto the canvas
  4. Connect components to clean up resources, save data, or perform other shutdown tasks

Documentation

License

Apache License 2.0

相关推荐

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

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

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

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

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

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

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

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

  • 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

  • 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.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

    Reviews

    5 (1)
    Avatar
    user_8dtM4zZu
    2025-04-16

    I have been using the xai-mcp by XpressAI and it has significantly impressed me with its performance and robustness. The utility and ease of integration into my workflow are unmatched. If you're looking for a reliable and efficient mcp application, this is definitely the one to go for. Highly recommended!