بنقرة واحدة
add-mcp-tool
How to expose a CSFD scraper function as a tool for AI agents via the Model Context Protocol server.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
How to expose a CSFD scraper function as a tool for AI agents via the Model Context Protocol server.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
A workflow to verify that code changes (refactoring, new features) didn't break the scraper or the build.
A complete guide to adding a new data field to the CSFD scraper (e.g., extracting "budget" or "studio" from a movie page).
استنادا إلى تصنيف SOC المهني
| name | Add MCP Tool |
| description | How to expose a CSFD scraper function as a tool for AI agents via the Model Context Protocol server. |
This skill explains how to Register a new tool in the MCP server so it can be used by LLMs.
The functionality must already exist in a Service (e.g., csfd.movie(id)). If not, use the implement_scraper_feature skill first.
mcp-server/index.tsUse Zod to define the input arguments.
Rule: Every .describe() call is part of the prompt for the AI. Be descriptive!
const toolArgs = {
myParam: z.string().describe('Description of what this parameter does...')
};
Add the server.tool() call.
server.tool(
'tool_name_snake_case',
'A clear, action-oriented description of what the tool does. Mention required inputs.',
toolArgs,
async ({ myParam }) => {
try {
// 1. Call the service
const result = await csfd.someMethod(myParam);
// 2. Return JSON content
return {
content: [
{
type: 'text',
text: JSON.stringify(result, null, 2)
}
]
};
} catch (error) {
// 3. Handle errors gracefully
return {
content: [{ type: 'text', text: `Error: ${error}` }],
isError: true
};
}
}
);
yarn build:mcp (to check types)main() or use the MCP Inspector if configured.