MCP ExplorerExplorer

Mcp Poc

@sairam356on 9 months ago
2 MIT
FreeCommunity
AI Systems
MCP-POC demonstrates real-time LLM workflows using MCP and OpenAI function calling.

Overview

What is Mcp Poc

MCP-POC is a proof-of-concept implementation that demonstrates the integration of the Model Context Protocol (MCP) with OpenAI’s function calling to create real-time workflows powered by large language models (LLMs).

Use cases

Use cases include blocking a credit card by issuing a natural language prompt, where GPT selects the appropriate tool, extracts necessary information, and interacts with the backend to provide a real-time response.

How to use

To use MCP-POC, install the dependencies, set your OpenAI API key in a .env file, and run the server and client in separate terminals. You can then issue natural language prompts to interact with the system.

Key features

Key features include dynamic tool selection by GPT, automatic extraction of required arguments, secure backend logic calls using StdioClientTransport, and compatibility with various server tools like TypeScript, JavaScript, and Python.

Where to use

MCP-POC can be used in various fields such as customer service automation, financial services (e.g., blocking credit cards), and any application requiring real-time interaction with backend systems through natural language processing.

Content

🚀 MCP-POC — GPT + Model Context Protocol (MCP) in Action

This is a proof-of-concept implementation demonstrating how to use Model Context Protocol (MCP) with OpenAI function calling to build real-time LLM-native workflows.


🔥 What It Does

  • Connects GPT-4 to backend tools via the MCP protocol
  • Lets GPT choose the right tool dynamically
  • Extracts required arguments automatically
  • Calls backend logic securely using StdioClientTransport

💳 Example Use Case: Block a Credit Card

With just a natural language prompt:

“Please block my card 1234567890123456 because it was stolen.”

✅ GPT:

  • Selects the blockCreditCard tool
  • Extracts cardNumber and reason
  • Calls the backend tool via MCP
  • Returns a real-time response

🛠 Tech Stack

  • 🔗 Model Context Protocol (MCP)
  • 🧠 OpenAI function calling (tool_choice: “auto”)
  • ⚙️ TypeScript + Node.js
  • 📦 Zod schema for input validation
  • 🔄 Stdio transport for client/server connection
  • 🌱 Lightweight and easy to extend

📁 Project Structure

src/
├── client/         # Smart OpenAI-powered client
│   └── client.ts
├── server/         # MCP server exposing tools
│   └── index.ts
.env                # Your OpenAI API key
package.json
tsconfig.json

🧪 Getting Started

  1. Install dependencies
npm install
  1. Set your OpenAI key

Create a .env file:

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Run the project

In one terminal:

npm run start:server

In another terminal:

npm run start:client
  1. Try a natural prompt
Please block my credit card 1234567890123456 due to fraud

📌 Highlights

  • ✅ No hardcoded logic or prompts
  • ✅ Tool selection + argument extraction are automatic
  • ✅ Works with .ts, .js, or .py server tools
  • ✅ Protocol-driven, agent-ready foundation

📎 Related


🙌 Author

Built by Venkata Sairam Gollamudi
📬 [email protected]

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers