
memory stream client transport
一个自定义的 MCP 客户端传输库,用于简化与本地 MCP 服务器的连接,避免使用子进程。
Repository Info
About This Server
一个自定义的 MCP 客户端传输库,用于简化与本地 MCP 服务器的连接,避免使用子进程。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
A custom MCP client transport - an alternative for connecting to local MCP servers without subprocesses, simplifying shared memory usage.
Usage
client code
import { MemoryStreamClientTransport } from 'memory-stream-client-transport'
import {createMcpServer} from './server'
const client = new Client({
name: "example-client",
version: "1.0.0"
}, {
capabilities: {}
});
const customTransport = new MemoryStreamClientTransport()
createMcpServer(customTransport)
await client.connect(customTransport);
console.log('connected')
const tools = await client.listTools()
console.log('tools', tools)
const result = await client.callTool({
name: tools.tools[0].name,
arguments: {}
})
console.log('result', result)
server code
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
export default async function createMcpServer(clientTransport){
const server = new McpServer({
name: "example-server",
version: "1.0.0"
}, {
capabilities: {}
});
server.tool('get_current_time', 'get current time', {}, async () => {
console.log('get_current_time called', Date.now())
return {
content: [
{
type: 'text',
text: new Date().toString()
}
]
}
})
const transport = new StdioServerTransport(clientTransport.process.stdin, clientTransport.process.stdout);
await server.connect(transport);
return server
}
Quick Start
Clone the repository
git clone https://github.com/kenshinlin/memory-stream-client-transportInstall dependencies
cd memory-stream-client-transport
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.