mcp-client
Skill1 starsChanged 3 months agoApache-2.0View on GitHub
Call tools on a remote MCP (Model Context Protocol) server over streamable HTTP. Use whenever a connector is an MCP server (e.g. the “MCP server” connector type), or the user asks to list or invoke an MCP server’s tools, prompts, or resources.
- Sends data out
4 other projects use a version of this.
Adopted by
Most recently taken up by
- leonardoaraujosantos/my_ai_skillstheir own version, first seen Jul 6, 2026
- harryleemedia/second-braintheir own version, first seen Mar 17, 2026
- walidboulanouar/Ay-Skillstheir own version, first seen Mar 10, 2026
- coleam00/second-brain-skillstheir own version, first seen Jan 24, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- coleam00/second-brain-skills★ 819same name
- walidboulanouar/Ay-Skills★ 90same name
- harryleemedia/second-brain★ 16same name
- leonardoaraujosantos/my_ai_skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- AGENTS.mdAGENTS.md
- building-agentsSkill
- building-workflowsSkill
- claude-apiSkill
- cross-tool-researchSkill
- daily-briefingSkill
- dashboard-designSkill
- docxSkill
- frontend-designSkill
- internal-commsSkill
- mcp-builderSkill
- pdfSkill
- pptxSkill
- skill-creatorSkill
- status-updateSkill
- tines-casesSkill
- tines-export-to-3bSkill
- workflow-discoverySkill
- workflow-operationsSkill
- workflow-reviewSkill
- workflow-volume-designSkill
- xlsxSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Every request is a POST to the server URL with Content-Type: application/json and Accept: application/json, text/event-stream.
- Very specific: line 64
If the response carries an Mcp-Session-Id header, echo it on every subsequent request (the helper above does this).
- Distinctive: line 66
When finished, send a DELETE to the endpoint with the session header if the server supports it.
- Very specific: line 102
Prefer one short-lived session per task.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Using a remote MCP server
An MCP server is a JSON-RPC 2.0 API behind a single HTTP endpoint. Talk to it with plain fetch from execute or a step, with the MCP connector attached — the platform injects authentication on matching requests, so never set Authorization headers yourself, and never print or store tokens.
Read the body of every error response, as the helper below does. A 403 with "error": "connector_not_connected" means the user hasn’t connected their own account to a visitor-mode connector: show them the body’s message, and its connect_url as a link if present, then retry once they’ve connected. A 403 whose body is a JSON-RPC error saying a tool “is not allowed by this connector” means the connector only allows the tools its message lists: don’t retry or reconnect, use an allowed tool or tell the user that a connector manager can allow this one. Any other 401 or 403 means the user needs to reconnect the connector; tell them so rather than attempting an auth flow yourself.
Request basics
Every request is a POST to the server URL with Content-Type: application/json and Accept: application/json, text/event-stream. The response is either plain JSON or an SSE stream; for SSE, parse each data: line as JSON and take the message whose id matches your request. This helper handles both:
let sessionId: string | undefined;
async function mcp(
url: string,
method: string,
params?: Record<string, unknown>,
id?: number
) {
const res = await fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json, text/event-stream",
...(sessionId ? { "Mcp-Session-Id": sessionId } : {}),
},
body: JSON.stringify({
jsonrpc: "2.0",
method,
...(params ? { params } : {}),
...(id !== undefined ? { id } : {}),
}),
});
sessionId = res.headers.get("Mcp-Session-Id") ?? sessionId;
const text = await res.text();
if (!res.ok)
throw new Error(`${method}: HTTP ${res.status}: ${text.slice(0, 500)}`);
if (id === undefined) return; // notification, no response expected
const messages = res.headers
.get("Content-Type")
?.includes("text/event-stream")
? text
.split("\n")
.filter((line) => line.startsWith("data:"))
.map((line) => JSON.parse(line.slice(5)))
: [JSON.parse(text)];
const reply = messages.find((m) => m.id === id);
if (!reply) throw new Error(`${method}: no response with id ${id}`);
if (reply.error) throw new Error(`${method}: ${JSON.stringify(reply.error)}`);
return reply.result;
}Session lifecycle
- Send
initializewithprotocolVersion: "2025-06-18",capabilities: {}, and yourclientInfo. If the server rejects the protocol version, retry with the version it offers in the error. - If the response carries an
Mcp-Session-Idheader, echo it on every subsequent request (the helper above does this). - Send a
notifications/initializednotification (noid). - When finished, send a DELETE to the endpoint with the session header if the server supports it; ignore a 405.
await mcp(
SERVER_URL,
"initialize",
{
protocolVersion: "2025-06-18",
capabilities: {},
clientInfo: { name: "3B", version: "1.0" },
},
1
);
await mcp(SERVER_URL, "notifications/initialized");Tools, prompts, and resources
tools/listreturns tool names, descriptions, and JSON Schema inputs. Page withcursorif the result hasnextCursor. Cache the list in a file instead of re-fetching every turn.tools/calltakes{ name, arguments }. The result hascontentblocks (usually{ type: "text", text }); checkisErrorbefore trusting the output.prompts/list,prompts/get,resources/list, andresources/readfollow the same request shape.
const { tools } = await mcp(SERVER_URL, "tools/list", {}, 2);
const result = await mcp(
SERVER_URL,
"tools/call",
{
name: "some_tool",
arguments: { query: "example" },
},
3
);
if (result.isError) throw new Error(result.content?.[0]?.text);Prefer one short-lived session per task. If a long-running call streams progress notifications over SSE, ignore messages without your request id — only the matching response carries the result.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

