MCP.so
Sign In

MCP-Demo: MCP Integration with OpenAI

@lomaxc

Basic information

Category

AI & Agents

Transports

stdio

Author

lomaxc

About MCP-Demo: MCP Integration with OpenAI

Initial C# MCP SDK Client-Server Example

MCP-Demo: MCP Integration with OpenAI config

No standard config provided

This server doesn't expose a parseable MCP config block in its README. See the repository for install instructions.

Repository

MCP-Demo: MCP Integration with OpenAI tools

Tool list not available yet

This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.

We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.

Overview

What is MCP-Demo?

MCP-Demo is a .NET demonstration of the Model Context Protocol (MCP), showcasing how to create MCP clients and servers and integrate them with OpenAI’s LLM capabilities. It is intended for developers exploring standardized ways to extend LLM functionality with custom tools.

How to use MCP-Demo?

Clone the repository, build with dotnet build, set the OpenAI API key via user secrets (dotnet user-secrets set "OpenAI:ApiKey" "your-api-key-here"), then run the LLM integration application with dotnet run in the MCP.LlmIntegration directory. The demo starts an interactive chat interface that connects to OpenAI and allows conversation-driven tool execution.

Key features of MCP-Demo

  • Exposes three MCP server tools: Echo, Add, and GetDateTime
  • Integrates with OpenAI’s Chat API for natural language queries
  • Maintains conversation context across interactions
  • Automatically starts the MCP server when running the LLM integration
  • Supports tool discovery via the McpServerTool attribute

Use cases of MCP-Demo

  • Testing and learning the Model Context Protocol in .NET applications
  • Demonstrating how an LLM can invoke custom calculations via natural language
  • Showing AI integration with system data, such as current date and time
  • Prototyping LLM-powered tools that require external data or logic

Frequently asked questions

1

What tools does the MCP server expose?

The server exposes three tools: Echo (returns a greeting with the input message), Add (adds two numbers), and GetDateTime (returns the current date and time).

2

How do I set up my OpenAI API key?

Run `dotnet user-secrets set "OpenAI:ApiKey" "your-api-key-here"` inside the `MCP.LlmIntegration` project directory.

3

What are the runtime requirements?

The project requires .NET 9.0 SDK and an OpenAI API key. A code editor like Visual Studio, VS Code, or JetBrains Rider is recommended.

4

Can I add new tools?

Yes, add a method with the `[McpServerTool]` attribute to the `DemoTools` class; the tool is automatically discovered and made available to the LLM.

5

What transport does the MCP server use?

The client connects to the server using stdio (standard input/output).

Comments

More AI & Agents MCP servers