Skip to content

Add MCP TypeScript server and client starter#1

Open
mx369 wants to merge 1 commit intomainfrom
codex/create-ts-node.js-mcp-server-and-client
Open

Add MCP TypeScript server and client starter#1
mx369 wants to merge 1 commit intomainfrom
codex/create-ts-node.js-mcp-server-and-client

Conversation

@mx369
Copy link
Owner

@mx369 mx369 commented Jan 20, 2026

Motivation

  • Provide a minimal TypeScript (Node.js) starter that implements an MCP server and a client so developers can quickly run and experiment with MCP tools.
  • Include a simple built-in ping tool and an api_request tool that forwards requests to an external API using an API key from the environment.
  • Supply project configuration, environment template, and documentation to make the project runnable out of the box.

Description

  • Add src/server.ts which creates an McpServer, registers a ping tool, and registers an api_request tool with zod input validation that forwards HTTP requests using fetch and an API_KEY from the environment.
  • Add src/client.ts which creates a Client that starts the server via StdioClientTransport, lists tools, calls the ping tool, and can optionally call api_request when RUN_API_REQUEST=true.
  • Add project files including package.json (dependencies: @modelcontextprotocol/sdk, dotenv, zod), tsconfig.json, and an environment template .env.example for configuration.
  • Update README.md with setup, run, and build instructions and examples for running the client and server.

Testing

  • No automated tests were run as part of this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant