Use MCP
Agent Buildinguse-mcpUse MCP is an Agent Skill for agent building published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
[AI & Tools] Utilize tools of Model Context Protocol (MCP) servers
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/integration/use-mcp-duc01226-easyplatform/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/use-mcp, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
[IMPORTANT] Use
TaskCreateto break ALL work into small tasks BEFORE starting — including tasks for each file read. This prevents context loss from long files. For simple tasks, AI may ask user whether to skip.
Quick Summary
Goal: Utilize MCP (Model Context Protocol) server tools to extend Claude's capabilities.
Workflow:
- Discover -- List available MCP tools and their capabilities
- Select -- Choose appropriate tool for the task
- Execute -- Run MCP tool with correct parameters
Key Rules:
- Check available MCP servers before attempting to use tools
- Use MCP tools for capabilities not available in built-in tools
- Handle MCP tool errors gracefully with fallback approaches
Execute MCP operations via Gemini CLI to preserve context budget.
Execution Steps
-
Execute task via Gemini CLI (using stdin pipe for MCP support):
# IMPORTANT: Use stdin piping, NOT -p flag (deprecated, skips MCP init) echo "$ARGUMENTS. Return JSON only per GEMINI.md instructions." | gemini -y -m gemini-2.5-flash -
Fallback to mcp-manager subagent (if Gemini CLI unavailable):
- Use
mcp-managersubagent to discover and execute tools - If the subagent got issues with the scripts of
mcp-managementskill, usemcp-builderskill to fix them - DO NOT create ANY new scripts
- The subagent can only use MCP tools if any to achieve this task
- If the subagent can't find any suitable tools, just report it back to the main agent to move on to the next step
- Use
Important Notes
- MUST use stdin piping - the deprecated
-pflag skips MCP initialization - Use
-yflag to auto-approve tool execution - GEMINI.md auto-loaded: Gemini CLI automatically loads
GEMINI.mdfrom project root, enforcing JSON-only response format - Parseable output: Responses are structured JSON:
{"server":"name","tool":"name","success":true,"result":<data>,"error":null}
Anti-Pattern (DO NOT USE)
# BROKEN - deprecated -p flag skips MCP server connections!
gemini -y -m gemini-2.5-flash -p "..."
IMPORTANT Task Planning Notes (MUST FOLLOW)
- Always plan and break work into many small todo tasks
- Always add a final review todo task to verify work quality and identify fixes/enhancements