Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/olaservo/mcp-agent-skillsnpx agentmods add skills/olaservo/mcp-agent-skills/mcp-client-tsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/olaservo/mcp-agent-skills/mcp-client-ts)<a href="https://agentmods.dev/skills/olaservo/mcp-agent-skills/mcp-client-ts"><img src="https://agentmods.dev/badge/skills/olaservo/mcp-agent-skills/mcp-client-ts/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/olaservo/mcp-agent-skills/mcp-client-ts"><img src="https://agentmods.dev/badge/skills/olaservo/mcp-agent-skills/mcp-client-ts.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00050 | $0.04418 |
| Opus 5 | $0.00025 | $0.02209 |
| Sonnet 5 | $0.00010 | $0.00884 |
| Haiku 4.5 | $0.00005 | $0.00442 |
Grade A, and why
mcp-client-ts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 641 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript MCP Client Builder
Build MCP (Model Context Protocol) clients in TypeScript using code snippets and patterns from the official SDK.
Now includes advanced capability support: sampling handlers, elicitation, roots, dynamic discovery, resource subscriptions, and task support with persistence.
How It Works
- Browse the snippet catalog below or in
snippets/ - Copy the snippets you need into your project
- Customize the copied code for your use case
- Connect to your MCP server and use tools/resources/prompts
Quick Start Decision Tree
Which Snippet Should I Start With?
Building an agentic app where an LLM decides when to use tools?
└─> Use client-with-llm snippet
Includes Claude integration, tool calling loop, interactive chat
Just need direct MCP server access (no LLM)?
└─> Use client-setup snippet
Basic connection, manual tool/resource/prompt calls
Which Transport Should I Use?
Connecting to a local process (CLI tool, desktop app)?
└─> Use StdioClientTransport
Examples: Claude Desktop, CLI applications, local dev servers
Connecting to a remote HTTP server?
└─> Use StreamableHTTPClientTransport
Examples: Cloud-hosted MCP servers, web services
Need to support legacy SSE-only servers?
└─> Use StreamableHTTP with SSE fallback pattern
See transport-http snippet for fallback example
Phase 1: Research
1.1 Identify Your Server
Before writing code, understand:
- What MCP server are you connecting to?
- How is the server started? (local process vs remote URL)
- Does the server require authentication?
- What tools/resources/prompts does it expose?
1.2 Browse Available Snippets
| Snippet | Description | Best For |
|---|---|---|
client-setup |
Basic Client with connection pattern | Direct MCP access without LLM |
client-with-llm |
Agentic client with Claude (API/Bedrock/Vertex/Azure) | LLM-powered tool calling apps |
transport-stdio |
StdioClientTransport examples | Local/subprocess servers |
transport-http |
StreamableHTTPClientTransport examples | Remote HTTP servers |
sampling-handler |
Handle sampling requests with tool support (MCP 2025-11-25) | Servers that need Claude completions |
elicitation-handler |
Handle user input requests (form/URL) | OAuth, confirmations, data collection |
roots-handler |
Expose filesystem directories | IDE integrations, file tools |
list-changed |
React to dynamic capability changes | Real-time tool/resource updates |
subscriptions |
Subscribe to resource updates | Live data feeds, monitoring |
logging |
Receive server log messages with level filtering | Debugging, monitoring |
completions |
Argument autocomplete with interactive picker | IDE-like experiences |
tasks |
Task support for long-running operations with streaming | Servers with async/long-running tools |
persistent-task-store |
File-based task persistence with TTL | Resumable task tracking |
What ships with it
19 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- manifest.json 3.1 KB
- reference/typescript_client_patterns.md 11 KB
- snippets/capabilities/tasks-receiver.ts 11 KB runs code
- snippets/capabilities/tasks.ts 8.5 KB runs code
- snippets/client/index.ts 4.0 KB runs code
- snippets/client/multi-server.ts 17 KB runs code
- snippets/client/with-llm.ts 10 KB runs code
- snippets/features/annotations.ts 4.9 KB runs code
- snippets/features/completions.ts 6.0 KB runs code
- snippets/features/list-changed.ts 2.0 KB runs code
- snippets/features/logging.ts 2.7 KB runs code
- snippets/features/subscriptions.ts 1.5 KB runs code
- snippets/features/tool-annotations.ts 5.4 KB runs code
- snippets/handlers/elicitation.ts 2.3 KB runs code
- snippets/handlers/roots.ts 1.7 KB runs code
- snippets/handlers/sampling.ts 11 KB runs code
- snippets/stores/persistent-task-store.ts 8.7 KB runs code
- snippets/transports/http.ts 3.5 KB runs code
- snippets/transports/stdio.ts 2.7 KB runs code
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 10d ago First seen · 641 lines · 50 tokens per session scan A 8684371247cb
mcp-client-ts is a skill published in the GitHub repository olaservo/mcp-agent-skills (2 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 50 tokens to every session and 4,418 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
no-bare-casts
Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.
aws-sst-development
SST v4 (Ion) expert for managing AWS resources as code with the Pulumi-backed framework.
league-akari-shard-development
Use when creating, extending, refactoring, splitting, or reviewing League Akari main or renderer shards, including shard file organization, controller/loader/executor/handler boundaries, naming conventions, renderer TSX usage, platform guards, and public contract compatibility.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
fast-typescript-check
Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…
migrate-better-result-3
Migrate a TypeScript codebase from better-result 2.x to 3.0. Use when upgrading better-result across the TaggedError syntax, removed Result serialization helpers, recovery inference, matching, or retry APIs.