Demonstrates a .NET MCP server with STDIO transport and TimeTool for local model tool integration
LCMCPserver is a demonstration implementation of an MCP (Model Context Protocol) server, showcasing how to create and configure servers that are compatible with various AI applications. This application serves as a bridge between language models and external tools or data sources through the Model Context Protocol, similar to how USB-C connectors facilitate device interoperability. By utilizing LCMCPserver, developers can enhance their AI applications to interact more effectively with local systems and tools.
LCMCPserver provides a robust implementation of the MCP protocol, enabling seamless integration with various AI clients such as Claude Desktop, Continue, and Cursor. Key features include:
TimeTool
), demonstrating the integration of time-related functionality into AI workflows.The architecture of LCMCPserver is built around .NET 9.0 SDK, ensuring compatibility and performance in modern computing environments. It leverages the ModelContextProtocol library to provide a unified interface for external tools. The server uses standard input/output (STDIO) as its communication channel, simplifying both setup and use.
The server is configured using a .NET Generic Host with the following key components:
To get started with LCMCPserver, follow these steps:
dotnet build
dotnet run
TimeTool
)The TimeTool
is a simple implementation that returns the current server time in ISO 8601 format (YYYY-MM-DDThh:mm:ssZ). This tool serves as an example of how to create and register custom tools for MCP clients.
LCMCPserver supports several key use cases in AI workflows, including:
TimeTool
can provide real-time information from the server.Consider a scenario where an AI application needs to know the current date and time in ISO format. By connecting it to LCMCPserver running TimeTool
, the AI can request and receive this information with minimal setup. This integration allows the AI application to handle context-specific requirements without requiring hardcoded values.
In complex development workflows, tools provided by servers like LCMCPserver can offer detailed debugging information or profiling data. For instance, an AI application might request memory usage statistics from a tool integrated with the server to optimize performance during runtime.
This demo server is compatible with multiple MC clients, including:
The following matrix outlines the compatibility of each MCP client with LCMCPserver:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
LCMCPserver has been tested and optimized for performance with the following considerations:
Advanced users can customize LCMCPserver for specific needs. Key configuration aspects include:
Here’s a sample JSON configuration file snippet illustrating how to set up the server with environment variables:
{
"mcpServers": {
"LocalMcpServer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-local"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
TimeTool
contribute to AI workflows?
A: TimeTool
provides real-time data and helps in timestamp-based operations, enhancing accuracy in application scenarios.For developers looking to contribute to LCMCPserver:
The Model Context Protocol has an expanding ecosystem with numerous resources and tools available. For comprehensive integration, developers can explore the following resources:
By leveraging LCMCPserver, developers can build more flexible and powerful AI applications that seamlessly integrate with local tools and data sources.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration