The MCP server is currently experimental and may change in the future. During this period, it is disabled by default. To stabilize it, and make bknd MCP native, all configuration changes you can make today with the integrated Admin UI will be migrated to use the MCP server.
bknd includes a fully featured MCP server that can be used to interact with the bknd instance. It uses a lightweight MCP implementation that works in any environment bknd works in. Unlike other MCP servers, the exposed tools and resources are mainly dynamically generated from the schema, extracted from defined hono routes, and manually defined ones. This means exposed tools and resources are always up to date, and requires little overhead to maintain.
Fully featured, always up to date MCP server natively integrated with bknd
Integrated MCP UI accessible from the Admin UI
Built-in MCP client directly usable from your app instance
CLI command to run an MCP server on stdio transport
Using the Admin UI, you can either navigate to /settings/server or click top right on the user menu, select "Settings", then "Server". Enable the MCP server by checking the "Enabled" checkbox under "Mcp".
The implementation is closely following the MCP spec 2025-06-18 powered by jsonv-ts, therefore any spec compliant client will work. However, there is a built-in MCP client:
import { McpClient } from "bknd/utils";const client = new McpClient({ url: "http://localhost:1337/api/system/mcp",});
Alternatively, similar to the getApi function, you can use the getMcpClient function to get the client from your app instance that doesn't travel through the network.
Unlike the official spec requires, there is no initialization required, but supported. Without connecting, initialization or fetching the list of tools, you can directly call them. For example, you could fetch a list of posts:
To start an MCP server on stdio transport, you can use the mcp CLI command. This is useful when you want to use it with IDEs or other tools that support stdio transport.
npx bknd mcp
If you want have the Streamable HTTP endpoint disabled, you can still use the STDIO transport by passing the --force option.
You can also use the MCP server in external tools, such as VS Code, Cursor, or other IDEs that support MCP. This list is not exhaustive, and will be updated.
Both the Streamable HTTP and STDIO transport support authentication. The same authentication mechanism as the API is used, so permissions work the exact same way.
When using the Streamable HTTP transport, you can pass the Authorization header to the client.