demo-ts-mcp-client-server
This project demonstrates a fundamental client-server interaction using the Model Context Protocol (MCP) to extend AI model capabilities.
Demo MCP Basic is a project that showcases the integration of AI models with external tools via the Model Context Protocol (MCP). The server acts as an MCP provider, offering basic calculation tools, while the client uses the AI SDK to interact with a Google AI model and connect to the MCP server. This setup allows AI models to access custom functionalities hosted on an MCP server, enhancing their capabilities. The project requires Node.js, npm, and a Google AI API Key for setup. It includes scripts for building and running the server and client in both production and development modes. The client script demonstrates connecting to the MCP server, fetching tools, configuring the AI model, executing prompts, and outputting results.
Features
- Securely extends AI model capabilities with external tools.
- Demonstrates client-server interaction using MCP.
- Includes scripts for building and running in different modes.
- Supports Google AI models via API Key or Vertex AI.
- Illustrates tool fetching and AI model configuration.
MCP Tools
- Addition Tool: Performs addition operations.
- Subtraction Tool: Performs subtraction operations.
Usage with Different Platforms
Node.js
bash
npm run build
npm run start
Google AI
bash
# Ensure .env is configured with your API keys
npm run start:client
Frequently Asked Questions
What is the purpose of the MCP server?
The MCP server provides external tools that can be used by AI models to extend their capabilities.
How do I configure the AI model?
The AI model is configured using environment variables set in the .env file, which include API keys and project IDs.
Related MCP Servers
View all developer_tools servers →Sequential Thinking🏅
by modelcontextprotocol
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.
context7
by upstash
Context7 MCP provides up-to-date, version-specific documentation and code examples directly into your prompt, enhancing the capabilities of LLMs by avoiding outdated or hallucinated information.
git-mcp
by idosal
GitMCP is a free, open-source, remote Model Context Protocol (MCP) server that transforms GitHub projects into documentation hubs, enabling AI tools to access up-to-date documentation and code.
Everything MCP Server
by modelcontextprotocol
The Everything MCP Server is a comprehensive test server designed to demonstrate the full capabilities of the Model Context Protocol (MCP). It is not intended for production use but serves as a valuable tool for developers building MCP clients.
exa-mcp-server
by exa-labs
A Model Context Protocol (MCP) server allows AI assistants to use the Exa AI Search API for real-time web searches in a secure manner.
repomix
by yamadashy
Repomix is a tool that packages your entire codebase into a single, AI-friendly file, making it easier to use with AI tools like LLMs.
Sequential Thinking MCP Server
by modelcontextprotocol
An MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.