Developers
Connect your MCP servers
Connect an MCP server and the agent calls its tools as the visitor. Tools marked read-only it uses freely;
anything else waits for the visitor to allow it, unless you turn that off for the server. For a signed-in
visitor, every call carries
x-bindkit-user-token, with x-bindkit-user-id and
x-bindkit-user-email. Your server verifies the token and decides what that user may see and
change.
When someone on your team sends a component from the inbox, the agent fills it in with your read-only
tools, as that visitor. BindKit signs their token itself then, with the same secret, for five minutes, and
adds a bindkit_member claim with the team member's email, so you can tell who asked.
BindKit proves itself to your server with an Authorization header you enter, as below. A server that has you sign in on its own website instead, such as Stripe's, can be connected with Sign-in, as long as it follows the MCP authorization spec: it answers 401 and names its authorization server, which offers PKCE and dynamic client registration or client metadata documents. BindKit stores the sign-in encrypted, renews it by itself and revokes it when the server is removed.
import jwt from 'jsonwebtoken'
app.post('/mcp', async (req, res) => {
// The Authorization header you entered for this server in BindKit.
if (req.headers.authorization !== `Bearer ${process.env.MCP_TOKEN}`) return res.sendStatus(401)
// Who the agent is helping, as your server signed it. Missing for anonymous visitors.
const token = req.headers['x-bindkit-user-token']
const user = token ? jwt.verify(token, process.env.BINDKIT_SIGNING_SECRET) : null
// Set when a team member filling in a component asked, rather than the visitor.
const member = user?.bindkit_member
// Answer the MCP request as user.sub, and nobody else.
await handleMcpRequest(req, res, user)
})