mcp-tool-authoring

mcp-tool-authoring is a skill for Claude Code, Codex from kouroshez/coding-os. It costs 145 tokens per session (3,149 once invoked), scanned A, original, Apache-2.0.

A set of rules for creating Model Context Protocol tools, which let an AI agent call functions exposed by a server.

In plain words
What is it for?
Use it when adding or changing MCP tools in the repository's thinking, graph, board, or web-route code.
Why use it?
It helps new tools use the repository's required names, response envelope, registration process, and documentation workflow.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is - **Source:** [`src/core/thinking_os/tools/<module>.py::cos_my_new_tool`](../../core/thinking_os/tools/<module>.py).

Good fit Use it when adding or changing MCP tools in the repository's thinking, graph, board, or web-route code.

Compare 6 skills from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/kouroshez/coding-os
agentmods
npx agentmods add skills/kouroshez/coding-os/mcp-tool-authoring

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for mcp-tool-authoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring/github.svg)](https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring)
Your own site
<a href="https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring/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.

agentmods 80×15 button for mcp-tool-authoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/kouroshez/coding-os/mcp-tool-authoring"><img src="https://agentmods.dev/badge/skills/kouroshez/coding-os/mcp-tool-authoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 145 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,149 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00145 $0.03149
Opus 5.5 $0.00058 $0.01260
Sonnet 5.5 $0.00029 $0.00630
Haiku 4.5 $0.00015 $0.00315

Measured today against content hash 918e226b219c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-tool-authoring 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 today.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/new_tool.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

src/templates/meta/skills/mcp-tool-authoring/SKILL.md · 301 lines

How it starts

The opening of the file, as written. The whole thing — 301 lines — stays where its author put it; the contents beside it link to each section on GitHub.

mcp-tool-authoring

Purpose: Make every new cos_* MCP tool match the contract every other tool follows. Drift here breaks the agent (deferred-tool schema lookups), the envelope (Rule 13), or the migration (Rule 9). One canonical authoring path keeps the ~80 tools coherent.

Read when: editing files matching:

  • src/core/thinking_os/tools/*.py — MCP tools registered with the FastMCP server.
  • src/core/graph_os/tools/*.py — graph-side tools (cos_graph_*).
  • src/core/board_os/mcp_tools.py — Scrumban / task tools.
  • src/core/web/routes/*.py — HTTP routes that wrap an MCP tool for the Hub UI.
  • src/core/thinking_os/server.py — when registering a new tool module.

Skip when: editing tests, helpers, or non-tool internals.

The Five Hard Contracts

Every cos_* tool MUST satisfy ALL of:

1. Name prefix cos_ (Rule 2)

@mcp.tool
@safe_tool
async def cos_doc_search(query: str, limit: int = 5) -> dict:
    ...

Names without the cos_ prefix are silently rejected from the tool inventory. The inventory is the SSOT for docs/governance/mcp-tool-inventory.md (regenerated, not hand-edited).

2. Envelope shape via @safe_tool (Rule 13)

Every tool returns ok(data) or fail(category, message). The decorator does this for you:

from core.thinking_os.tools._shared import safe_tool, ok, fail

@mcp.tool
@safe_tool  # converts raw exceptions to fail() envelopes
async def cos_doc_search(query: str, limit: int = 5) -> dict:
    if not query:
        return fail("invalid_input", "query is required")

    rows = await _db.search(query, limit=limit)
    return ok({"results": rows, "count": len(rows), "meta": {"layer": "docs"}})

fail categories are documented in docs/engineering/mcp-error-envelope.md: invalid_input, not_found, unavailable, permission_denied, internal_error, rate_limited. Don't invent new categories without updating the contract doc.

3. ONE-line docstring (Rule 12)

Read the full file on GitHub · 301 lines

Files

What ships with it

2 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.

Changes

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.

  1. today Changed · -1 lines 918e226b219c
  2. 2mo ago First seen · 302 lines · 145 tokens per session scan A c73d26a7b23f

Subscribe to this mod's changes

mcp-tool-authoring is a skill published in the GitHub repository kouroshez/coding-os (7 stars, last pushed today), licensed Apache-2.0. It adds 145 tokens to every session and 3,149 once invoked, about $0.0006 per session on Opus 5.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-09-03.

Related

mcp-tool-authoring compared with skills from other repositories

mcp-tool-authoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-tool-authoringkouroshez/coding-osSkill7todayApache-2.0A145Claude Code, Codex
graph-mutation-planpotpie-ai/potpieSkill5.8k7d agoApache-2.0A22Claude Code, Codex
tencent-ima-wikizj-unicom-ai/UniEmployeeSkill7998d agoMITA127Claude Code, Codex
scienceworld-growth-focuserzjunlp/SkillNetSkill1.4k4d agoMITA71Claude Code, Codex
scienceworld-conditional-box-placerzjunlp/SkillNetSkill1.4k4d agoMITA59Claude Code, Codex
scienceworld-object-classifierzjunlp/SkillNetSkill1.4k4d agoMITA66Claude Code, Codex
scienceworld-tool-userzjunlp/SkillNetSkill1.4k4d agoMITA87Claude Code, Codex