For the complete documentation index, see llms.txt. This page is also available as Markdown.

Registering Tools, Resources & Prompts

Register capabilities that your MCP server exposes to clients.

Tool Registration

Register a Single Tool

server = MCPServer( "myApp" )
    .registerTool(
        aiTool( "getWeather", "Get current weather for a location", ( location ) => {
            return weatherService.getCurrent( location )
        } )
        .describeArg( "location", "City name or coordinates" )
    )

Register Multiple Tools

tools = [
    aiTool( "search", "Search documents", searchHandler ),
    aiTool( "translate", "Translate text", translateHandler ),
    aiTool( "summarize", "Summarize text", summarizeHandler )
]

server = MCPServer( "myApp" )
    .registerTools( tools )

Check & Retrieve Tools

Unregister Tools

Resource Registration

Resources provide access to documents and data.

Register a Resource

Register Dynamic Resources

List and Read Resources

Manage Resources

Prompt Registration

Prompts provide reusable prompt templates for AI clients.

Register a Prompt

List and Get Prompts

Fluent Registration Pattern

All registration methods return this for chaining:

Next Steps

Last updated