# Overview

Canonical URL: https://developers.iagenify.com/sdk/ref/mcp-client/
Language: en

The MCP client itself, exported from the package. Use it for a server you hold yourself — api.mcp is the same client plus the account's record of it.

Status: exported · https · stateless

```javascript
import { McpClient } from "iagenify";

const client = new McpClient({ url: "https://mcp.example.com/sse", token, name: "example" });

await client.initialize();
const tools = await client.listTools();
const result = await client.call("search_docs", { query: "retry policy" });
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `url` | string | required | The server's address. |
| `token` | string|null | null | Cleaned on the way in — surrounding spaces, quotes and a copied « Bearer » are removed. |
| `name` | string | "mcp" | Used to prefix tool names and in the header the specification asks for. |
| `fetchImpl` | function |  | A fetch of your own, for a runtime that needs it. |

## The methods {#methods}

| Call | Does |
| --- | --- |
| [initialize()](/sdk/ref/mcp-client/initialize) | Shakes hands and agrees a revision. |
| [listTools()](/sdk/ref/mcp-client/list-tools) | Every tool, paginated. |
| [call(name, args)](/sdk/ref/mcp-client/call) | Runs one. |

## And the pure helpers {#exports}

| Export | Does |
| --- | --- |
| [sanitizeSchema()](/sdk/ref/mcp-client/sanitize-schema) | A tool schema reduced to what providers accept. |
| [toolNameFor()](/sdk/ref/mcp-client/tool-name-for) | The prefixed, trimmed tool name. |
| [createMcpTools()](/sdk/ref/mcp-client/create-mcp-tools) | Servers into engine-shaped tools. |
| `MCP_PROTOCOL_VERSION` | The revision this client prefers. |

## It knows nothing about the account {#no-account}

> **No address check, no token storage, no allowed list**
>
> Those belong to api.mcp. Holding the client directly means the address is yours to vet — which is fine for a server you wrote, and a bad idea for one a user typed.

## Nothing to close {#stateless}

The revision this client prefers made the protocol core stateless: a call is an ordinary request and response. There is no connection to keep open and nothing to resume after a restart.

- [api.mcp](/sdk/ref/mcp): Connecting, listing and using a server.
- [Protocol revision](/sdk/mcp/protocol-revision): Which ones it speaks.

```python
from iagenify import McpClient

client = McpClient("https://mcp.example.com/sse", token=token, name="example")

client.initialize()
tools = client.list_tools()
result = client.call("search_docs", {"query": "retry policy"})
client.close()
```
