The scaffolded plugin includes a single MCP tool that demonstrates the self-installing pattern working end-to-end.
For scaffold_plugin("alligator", "After while, crocodile"):
"""MCP server for alligator-speak."""
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("alligator-speak")
@mcp.tool()
def speak_alligator() -> str:
"""Say something like a alligator."""
return "After while, crocodile"
if __name__ == "__main__":
mcp.run(transport="stdio")When this tool responds correctly, you know:
- The
SessionStarthook installedmcpinto the plugin's isolatedsite-packages PYTHONPATHis set correctly in.mcp.json- The MCP server started via
python3and connected over stdio - Claude discovered and invoked the tool by matching user intent
> speak alligator
🐊 "After while, crocodile!"
Rename speak_alligator to your real tool, update server.py
with your actual logic, and add dependencies to requirements.txt.
The plugin infrastructure (hooks, .mcp.json, plugin.json) stays
the same.