MewCPMewCP
  • AstheTech
  • Contact Us
  • Documentation
  • MewCP Auth API
Have a question?
  • ✉ Contact us - our dev team will reach out as soon as possible

© 2026 MewCP. All rights reserved.

githubx
Getting Started
Connect AI Apps
Frameworks & SDKs
    Vercel AI SDKGoogle ADKCrewAILangChain PythonLangChain TypeScriptLangGraphOpenAI Agents SDKClaude SDKPython MCP ClientTypeScript MCP Client
Authentication
Auth API Guides
powered by Zudoku
Frameworks & SDKs

TypeScript MCP Client

Install

TerminalCode
npm install @modelcontextprotocol/sdk

Connect

Code
import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; const GATEWAY_URL = "https://gateway.mewcp.com/personal/mcp"; const MEWCP_API_KEY = "API_KEY"; const transport = new StreamableHTTPClientTransport(new URL(GATEWAY_URL), { requestInit: { headers: { Authorization: `Bearer ${MEWCP_API_KEY}`, Accept: "application/json, text/event-stream", }, }, }); const client = new Client({ name: "my-node-client", version: "1.0.0", }); await client.connect(transport); const tools = await client.listTools(); console.log( "Available tools:", tools.tools.map((t) => t.name), ); // -> ["search", "get_schema", "list_accounts", "call_tool"]

Every app you have connected is reachable through this one endpoint. You get four tools rather than the tools of each app, and you use them to reach the rest.


Find a tool

Code
const found = await client.callTool({ name: "search", arguments: { query: "calendar events" }, }); // each hit carries the server_maskedId and tool_name you need next
Code
const schema = await client.callTool({ name: "get_schema", arguments: { tools: [{ server_maskedId: "google-calendar", tool_name: "list_events" }], }, });

Run a tool

Code
const result = await client.callTool({ name: "call_tool", arguments: { server_maskedId: "google-calendar", tool_name: "list_events", args: { calendar_id: "primary", time_min: "2026-01-15T00:00:00Z", time_max: "2026-01-16T00:00:00Z", }, }, }); console.log(result);

If your code already knows which tool it wants, call call_tool directly. search and get_schema exist for agents that have to work it out at runtime.


Choosing an account

When you have connected more than one account for the same app, list them and pass the one you want as alias:

Code
const accounts = await client.callTool({ name: "list_accounts", arguments: { provider: "google-gmail" }, }); const result = await client.callTool({ name: "call_tool", arguments: { server_maskedId: "google-gmail", tool_name: "list_messages", args: { max_results: 10 }, alias: "work", }, });

With a single connected account you can leave alias out.


B2B: audience member credential routing

If you are managing audience member credentials via the MewCP Auth API, identify the end user with a header and MewCP resolves their stored credential automatically:

Code
const transport = new StreamableHTTPClientTransport(new URL(GATEWAY_URL), { requestInit: { headers: { Authorization: `Bearer ${MEWCP_API_KEY}`, "x-mewcp-enduser-id": currentUser.id, }, }, });

Where to find your values

ValueWhere to get it
API_KEYDashboard -> API Keys
Connected appsDashboard -> Servers
Last modified on October 15, 2026
Python MCP ClientAPI Key
On this page
  • Install
  • Connect
  • Find a tool
  • Run a tool
  • Choosing an account
  • B2B: audience member credential routing
  • Where to find your values
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript
TypeScript