Agent skill
tmf-mcp-builder
Build TM Forum (TMF) MCP servers from TMF OpenAPI specs (TMF6xx/7xx YAML). Use when you are given a TMF OpenAPI file and asked to (1) implement an MCP server exposing TMF operations as tools, (2) generate a mock TMF API server + client + MCP layer, or (3) standardize tool naming, create/update inputs, $ref/allOf handling, and /hub event-subscription patterns for TMF APIs.
Install this agent skill to your Project
npx add-skill https://github.com/oopsyz/skills/tree/main/tmf-mcp-builder
SKILL.md
TMF MCP Builder
Workflow (decision tree)
-
Choose the product shape
- Wrap a real TMF API: Implement only the MCP server + HTTP client; no mock server.
- Generate a full dev sandbox: Mock server (FastAPI) + HTTP client + MCP server that proxies to the mock.
-
Choose the MCP framework (Python)
- Use the official
mcpPython SDK +FastMCP(recommended): implement tools directly with@mcp.tooland choose the transport (stdio or HTTP) based on your deployment needs.
- Use the official
-
Choose the implementation approach
- Hand-build: Use this skill as a checklist and build the server normally.
- LLM-assisted generation (this repo): Use
tmf_llm_agent.pyto generate a starter implementation from an OpenAPI YAML, then tighten tool schemas and edge cases.
Conventions (TMF-specific)
Naming
- Files (recommended for generated outputs)
tmf###_mock_server.pytmf###_client.pytmf###_mcp_server.pyrun_mock_server.py,run_mcp_server.py
- Tools
- Use snake_case with TMF prefix:
tmf{tmf_number}_{action}_{resource} - Standard actions:
list,get,create,patch(orupdate),delete, plushealth_check
- Use snake_case with TMF prefix:
Input ergonomics: create/update tools
For TMF create operations, prefer field-level parameters (LLM-friendly) and rebuild the TMF JSON internally.
- Read
references/resource-creation-guidelines.mdbefore implementingcreate_*tools. - Avoid a single blob parameter like
customer: dictunless you also provide ergonomic field inputs.
OpenAPI-driven behavior
When generating mock behavior from TMF OpenAPI:
- Treat
$refresolution as mandatory for realistic sample payloads. - Treat
allOfas mandatory (TMF uses it heavily). Merge allOf schemas (including cases wheretype: objectandallOfboth exist). - Identify main resources from the path set (e.g.,
/customer,/product,/service) and implement full CRUD for those first.
/hub and event endpoints
- Implement
/hubendpoints only if required by the spec or your use case. - If you implement them, keep them consistent: create/get/delete subscription, and store subscriptions in-memory for mocks.
Practical build steps (Python)
-
Inventory the spec
- Find the correct TMF OpenAPI YAML in https://github.com/tmforum-apis (users must pick the TMFxxx spec/version that matches their API).
- Determine base paths, main resources, and required operations.
- Extract required fields for create/patch input models.
-
Ensure tmf_commons is available
- Copy
assets/tmf_commonsinto your project root (or otherwise ensure it is importable). You can usescripts/copy_tmf_commons.py --dest <project-root>.
- Copy
-
Implement the HTTP client
- Use
httpx.AsyncClient. - Provide consistent error handling and timeouts.
- Use
-
Implement the mock server (optional)
- Use in-memory storage keyed by resource.
- Pre-populate sample objects.
- Support: list (filter/paginate), get by id, create, patch, delete.
-
Implement the MCP server
- Expose tools for the main resources.
- Make list tools pageable (
limit,offsetor cursor). - Return predictable structured JSON (and optionally a markdown view if your framework supports it).
-
Validate tool usability
- Tool names are discoverable.
- Create/update inputs are not "blob-only".
- Errors are actionable.
-
Add an evaluation set (recommended)
- Create 10 read-only questions that require multiple tool calls.
- If you need a template, follow the approach in the general mcp-builder evaluation guidance.
-
Generate README-TMFxxxx (required)
- Create a
README-TMF####.mdfile as the final step (after servers and tools are implemented). - Use the TMF number from the OpenAPI spec (for TMF620, generate
README-TMF620.md). - Include: overview, endpoints/tools list, run instructions (mock server + MCP server), and environment variables.
- Create a
-
Add requirements.txt (required)
- Create a
requirements.txtin the output folder that lists runtime dependencies. - Include at least:
fastapi,uvicorn,httpx,mcp,pyyaml.
- Create a
Bundled assets
- tmf_commons: copy ssets/tmf_commons into your project root when you want the shared mock server utilities (or run scripts/copy_tmf_commons.py --dest ).
References (load as needed)
-
Bundled assets: ssets/tmf_commons (copy into your project root if you need the shared mock server utilities).
-
All-in-one generator prompt:
references/TMF_MCP_SERVER_CREATION_PROMPT_all-in-one.md -
Libraries-based generator prompt:
references/TMF_MCP_SERVER_CREATION_PROMPT_libraries.md -
Create/update input rule (important):
references/resource-creation-guidelines.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
bpmn2skill
Generate a complete SKILL.md by parsing a BPMN 2.0 XML process and translating tasks, gateways, and events into skill actions and orchestration logic.
classdiagram-to-neo4j
Extract entities, properties, and relationships from UML class diagrams (images) and populate Neo4j graph database. Supports TMF-style diagrams, schema diagrams, and other UML class diagrams. Uses vision models for extraction and generates Cypher queries for Neo4j population.
security-github-review
Security review workflow for GitHub repositories using the Security MCP (OWASP ASVS + NIST 800-53) as the primary reference and mapping layer. Use when asked to security review a repo, produce an OWASP/NIST-aligned checklist, map findings to ASVS/NIST controls, generate a prioritized vulnerability report, or create security requirements/acceptance criteria from repo code/config.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?