Getting Started
What You'll Build
Step 1: Register Tools at Application Start
// Application.bx
class {
function onApplicationStart() {
// Get or create an MCP server instance
MCPServer( "myApp" )
.setDescription( "My Application MCP Server" )
.setVersion( "1.0.0" )
// Register first tool
.registerTool(
aiTool( "search", "Search for documents", ( query ) => {
return searchService.search( query )
} )
)
// Register second tool
.registerTool(
aiTool( "calculate", "Perform calculations", ( expression ) => {
return evaluate( expression )
} )
)
}
function onApplicationEnd() {
// Clean up on shutdown
bxModules.bxai.models.mcp.MCPServer::removeInstance( "myApp" )
}
}Step 2: Access the MCP Endpoint
Step 3: List Your Tools
Step 4: Invoke a Tool
What's Next?
Last updated