
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A TypeScript demo pairing an MCP server that offers simple calculation tools with an AI SDK client that connects to it.
Demo MCP basic client-server with calculation tools is cataloged as an MCP server attributed to bertrandgressier. A TypeScript demo pairing an MCP server that offers simple calculation tools with an AI SDK client that connects to it. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Demo MCP basic client-server with calculation tools are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
It offers simple calculation tools such as addition and subtraction.
The client fetches the server's tools and sends a prompt instructing the AI to use them to solve a calculation.
README.md · ef9f3876c28f · 采集于 2026-11-13 12:32:06 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
This project demonstrates a fundamental client-server interaction using the Model Context Protocol (MCP). MCP allows AI models, like those accessed via the AI SDK (e.g., Google Gemini/Vertex AI), to securely discover and utilize external tools or resources provided by a separate server process.
In this example:
src/server/) acts as an MCP provider, offering simple calculation tools (addition, subtraction, etc.).src/client/) uses the AI SDK to interact with a Google AI model and connects to the MCP server to make the server's tools available to the AI during generation.This setup illustrates how you can extend the capabilities of AI models by giving them access to custom functionalities hosted on an MCP server.
package.json)Clone the repository:
git clone git@github.com:bertrandgressier/demo-ts-mcp-client-server.git
cd demo-mcp-basic
Install dependencies:
npm install
Create Environment File:
Copy the example environment file .env.example to a new file named .env:
cp .env.example .env
Then, edit the .env file to add your actual API keys and configuration. The required and optional variables are:
# Required for Google Studio Models (Gemini)
GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY
# Required for Google Vertex AI Models
VERTEX_PROJECT_ID=YOUR_VERTEX_PROJECT_ID
# Optional: Defaults to 'us-central1' if not set
# VERTEX_LOCATION=your-vertex-location
# Optional: Path to Vertex AI service account key file. Defaults to 'vertex-key.json' in the root if not set.
# VERTEX_KEY_FILE=path/to/your/vertex-key.json
Replace YOUR_GOOGLE_API_KEY and YOUR_VERTEX_PROJECT_ID with your actual credentials.
If you use a Vertex AI key file, ensure it's placed correctly (e.g., in the root as vertex-key.json or provide the correct path in VERTEX_KEY_FILE).
.gitignore file is configured to prevent .env and vertex-key.json from being committed to Git.Build TypeScript:
npm run build
Compiles TypeScript code from src to JavaScript in dist.
Start Production Server:
npm run start
# or specifically
npm run start:server
Builds the project (if not already built) and runs the compiled server from dist/server/server.js.
Start Production Client:
npm run start:client
Runs the compiled client from dist/client/client.js.
Run Server in Development Mode:
npm run dev:server
Runs the server directly using ts-node (or similar via --experimental-transform-types) without needing a separate build step.
Run Server in Development Mode with Watch:
npm run dev:server:watch
Runs the server using nodemon, automatically restarting it when changes are detected in the src/server directory.
Run Client in Development Mode:
npm run dev:client
Runs the client directly using ts-node (or similar).
src/client/client.ts)The primary example client script demonstrates the following:
http://localhost:3001/sse).generateText) configured with a Google AI model (Gemini via API Key or Vertex AI, depending on environment variables set in .env and potentially src/models/google-ai-provider.ts).6 + 12) along with a system message instructing the AI to use the fetched tools to solve the calculation.This client serves as a basic illustration of how an application can interact with an MCP server to leverage its tools within an AI generation flow.
src/: Contains the TypeScript source code.
client/: Code for the MCP client application.server/: Code for the MCP server application.model.ts: Handles AI model initialization and environment variable loading.dist/: Contains the compiled JavaScript code (after running npm run build)..env: Stores environment variables (API keys, etc.) - Do not commit this file.package.json: Project metadata and dependencies.tsconfig.json: TypeScript compiler configuration.Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Demo MCP basic client-server with calculation tools from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/demo-ts-mcp-client-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.