# `BB.MCP.Server`
[🔗](https://github.com/beam-bots/bb_mcp/blob/main/lib/bb/mcp/server.ex#L5)

MCP server that exposes BB robots to AI agents.

The set of robots this server makes available is read from application
config at runtime:

    config :bb_mcp, robots: [MyApp.WX200, MyApp.SO101]

## Supervision

Add the server to your supervision tree alongside your robots:

    children = [
      MyApp.WX200,
      MyApp.SO101,
      {BB.MCP.Server, transport: :streamable_http, streamable_http: [port: 4000]}
    ]

## Phoenix mount

Mount over Streamable HTTP inside a Phoenix router using
`BB.MCP.Router.bb_mcp/2`:

    import BB.MCP.Router
    scope "/" do
      bb_mcp "/mcp"
    end

## Tools

Static cross-cutting tools (`list_robots`, `get_state`, `force_disarm`,
`list_commands`, `list_parameters`, `get_parameter`, `set_parameter`,
`send_joint_positions`) take a `robot` string argument identifying the
target robot.

Per-command tools are registered dynamically on session initialisation,
one per `{robot, command}` pair declared in each robot's Spark DSL.
Each is named `{robot}.{command}` (e.g. `wx200.home`) and carries the
command's typed argument schema. They are dispatched through
`handle_tool_call/3` to `BB.Robot.Runtime.execute/3` +
`BB.Command.await/2`.

## Resources

Resources are URI-templated by robot name. See `BB.MCP.Resources.*`.

# `child_spec`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
