SampleMcpServer
Mcp server with local RAG on pdf and word documents and web search
claude mcp add --transport stdio virex-84-samplemcpserver dotnet run \ --env EMBEDD_KEY="" \ --env EMBEDD_MODEL="text-embedding-nomic-embed-text-v2-moe" \ --env GUTHUB_TOKEN="github_pat_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy" \ --env EMBEDD_ENDPOINT="http://localhost:1234/v1/" \ --env WEB_SEARCH_ENGINES="DuckDuckGo,Firecraw, Baidu" \ --env WEB_SEARCH_FirecrawApiKey="fc-xxxxxxxxxxxxxxxxxxxxxxxxxx" \ --env WEB_SEARCH_duckduckgoRegion="en-en"
How to use
This MCP server is implemented in .NET and exposes a set of built-in tools that a client can invoke through the MCP protocol over stdio. Tools include random_number, calc for arithmetic (add, subtract, multiply, divide, power, square root), file_operations for reading/writing/listing files, internet_search using multiple search engines, github_search for GitHub repositories and code, and rag for retrieving information from local documents via FAISS. To use the server, build and run it with dotnet, then connect an MCP client using the stdio transport. The client can invoke any of the exposed tools by sending properly formed MCP requests, and receive structured responses from the server. The included example configuration shows how to set environment variables for embedding models and various search services; these are optional and can be adjusted per deployment.
How to install
Prerequisites:
- .NET SDK installed (compatible with the server project)
- Access to the repository containing SampleMcpServer
Step-by-step installation:
- Clone the repository: git clone https://github.com/your-org/SampleMcpServer.git
- Change into the project directory: cd SampleMcpServer
- Restore dependencies (via dotnet build will restore as well; this is shown for completeness): dotnet restore
- Build the project: dotnet build
- Run the server: dotnet run
- Connect your MCP client to the server using the stdio transport as demonstrated in the client documentation.
Notes:
- Ensure any required environment variables for search services and embedding endpoints are set if you plan to use those features.
- The server is configured to be run via the standard dotnet run command; adjust environment variables as needed in your deployment environment.
Additional notes
Tips and troubleshooting:
- If the server fails to start, check that the .NET SDK version matches the project requirements and that dependencies restore successfully.
- For search-related tools (internet_search, github_search) ensure the API keys and endpoints are correctly configured via environment variables (as shown in the example).
- The server communicates over stdio; if integrating with a GUI client, ensure the client passes requests in the expected MCP JSON-RPC format.
- If embedding features are used (EMBEDD_ENDPOINT, EMBEDD_MODEL, EMBEDD_KEY), verify the endpoint is reachable and the model name is correct. Missing or incorrect values may cause tool invocations to fail.
- You can customize the mcpServers mapping to suit different deployment environments; for example, rename the server or provide additional environment variables per server instance.
Related MCP Servers
mssql
MSSQL Server MCP implementation written in C#
McpDotNet.Extensions.SemanticKernel
Microsoft SemanticKernel integration for the Model Context Protocol (MCP). Enables seamless use of MCP tools as AI functions.
DatabaseMcpServer
MCP server from ttcc666/DatabaseMcpServer
mcp-dataverse
MCP Server for querying Dataverse using SQL
xperience-community
ASP.NET Core MCP server for Xperience by Kentico projects
console-to-http
Example of converting a stdio MCP server to HTTP using ModelContextProtocol.AspNetCore