Sponsored by Deepsite.site

Xircuits MCP Component Library

Created By
XpressAI9 months ago
A Xircuits component library for defining MCP servers.
Content

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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
DeepChatYour AI Partner on Desktop
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.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
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.
Playwright McpPlaywright MCP server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
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.
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"