Mjara Docs
Arif MCP

Building a Custom MCP Server

You can create your own MCP server to extend Arif AI with custom tools. For a comprehensive guide on building MCP servers, refer to the official MCP documentation:

Build an MCP Server — Model Context Protocol

Overview

An MCP server exposes two main endpoints:

  1. Tool Discovery — Returns a list of available tools with their schemas
  2. Tool Invocation — Executes a specific tool with validated parameters

Once your server is deployed, configure its endpoint in Arif AI Settings and your custom tools will be automatically discovered and available in the chat.

Quick Example

from fastapi import FastAPI

app = FastAPI()

@app.get("/mcp/tools")
async def get_tools():
    return {
        "tools": [{
            "name": "custom_analysis",
            "description": "Analyze business data",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "data": {"type": "string"},
                    "metric": {"type": "string"}
                },
                "required": ["data", "metric"]
            }
        }]
    }

@app.post("/mcp/invoke/{tool_name}")
async def invoke_tool(tool_name: str, params: dict):
    result = analyze_data(params["data"], params["metric"])
    return {"success": True, "result": result}

Next Steps

  1. Build your MCP server following the official guide
  2. Deploy it to your infrastructure
  3. Configure the endpoint in Arif AI Settings > MCP
  4. Your tools will be automatically discovered and available in the chat

On this page