typescript-mcp-client MCP server
✓ OfficialProvides a TypeScript test client to interact with and verify Model Context Protocol servers within test suites.
Also known as CodelyTV/typescript-mcp-client
- Stars
- 28
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Apr 5, 2026
- License
- GPL-3.0
What is typescript-mcp-client MCP?
typescript-mcp-client provides a TypeScript test client to interact with and verify Model Context Protocol servers within test suites.
Summary generated from the project's README
About typescript-mcp-client MCP server
Verifying Model Context Protocol server functionality within automated test suites is the primary purpose of this TypeScript client. Developers can integrate this package into their testing workflows to ensure that their MCP servers behave as expected before deployment.
Users can initialize the McpClient using either stdio or http transport methods. For stdio, you provide command arguments like npx and ts-node to launch the server process. For remote connections, you specify an http endpoint. The client provides specific methods to interact with the server, including listTools, callTool, listResources, and readResource. It also supports advanced interactions such as listResourceTemplates, completeResourceTemplateParam, listPrompts, and getPrompt.
This tool is designed for developers building MCP servers who need a programmatic way to validate tool calls, resource access, and prompt retrieval. By using the @codelytv/mcp-client package, you can automate the verification of tool names, resource URIs, and specific tool arguments within your existing TypeScript testing environment.
What you can do with it
- 1Verify available server toolsCheck that the MCP server correctly exposes the expected tool names to the client.
- 2Test specific tool executionExecute a tool with specific arguments to ensure the server returns the correct response.
- 3Validate resource accessibilityConfirm that the server can list and read specific resource URIs.
- 4Test prompt retrievalEnsure that the server provides the correct prompts when requested by name.
Written from the project's README. Every use case is checked against a quote from it.
README
View on GitHub⬇️ Installation
npm install --save-dev @codelytv/mcp-client
💻 Usage
Basic Example
import { McpClient } from '@codelytv/mcp-client';
const mcpClient = new McpClient("stdio", [
"npx",
"ts-node",
"./src/app/mcp/server.ts",
]);
await mcpClient.connect();
// List available tools
const tools = await mcpClient.listTools();
console.log('Available tools:', tools.names());
// Call a tool
const response = await mcpClient.callTool('search-course-by-id', { id: 'course-123' });
// List resources
const resources = await mcpClient.listResources();
console.log('Available resources:', resources.uris());
// Read a resource
const resource = await mcpClient.readResource('courses://all');
await mcpClient.disconnect();
HTTP Transport
const mcpClient = new McpClient("http", ["http://localhost:3000/mcp"]);
🔡 API
McpClient
The main client class for interacting with MCP servers.
Constructor
new McpClient(transport: "stdio" | "http", args: string[])
Methods
connect()- Connect to the MCP serverdisconnect()- Disconnect from the MCP serverlistTools()- List available toolscallTool(name: string, args?: Record<string, unknown>)- Call a toollistResources()- List available resourcesreadResource(uri: string)- Read a resourcelistResourceTemplates()- List resource templatescompleteResourceTemplateParam(uri: string, paramName: string, textToComplete: string)- Complete resource template parameterslistPrompts()- List available promptsgetPrompt(name: string, args?: Record<string, unknown>)- Get a prompt
👌 Codely Code Quality Standards
Publishing this package we are committing ourselves to the following code quality standards:
- 🤝 Respect Semantic Versioning: No breaking changes in patch or minor versions
- 🤏 No surprises in transitive dependencies: Use the bare minimum dependencies needed to meet the purpose
- 🎯 One specific purpose to meet without having to carry a bunch of unnecessary other utilities
- ✅ Tests as documentation and usage examples
- 📖 Well documented ReadMe showing how to install and use
- ⚖️ License favoring Open Source and collaboration
⚖️ License
See LICENSE
typescript-mcp-client MCP questions
How do I install the client?
You can install it using npm with the command: npm install --save-dev @codelytv/mcp-client
What transport protocols does the client support?
The client supports both stdio and HTTP transport protocols.
Can I list the tools available on an MCP server?
Yes, you can use the listTools() method to retrieve the available tools from the connected server.