Integrations
Framework guides
Integration examples for popular AI frameworks. The pattern is the same across all of them: construct a MiddlewareContext, call proxy.run(ctx, handler), return the result. For stdio servers, the CLI bridge requires zero code changes.
Vercel AI SDKPopular
Use @businys/ops with the Vercel AI SDK tool system.
Vercel AI SDKts
import { createMCPProxy } from "@businys/ops"
import { tool } from "ai"
const proxy = createMCPProxy()
// Wrap your AI SDK tools
async function handleToolCall(toolName: string, args: unknown) {
const ctx = {
toolName,
toolGroup: toolName.split("_")[0] ?? toolName,
toolTier: "kit" as const,
method: "tools/call",
path: "/tools/call",
input: args as Record<string, unknown>,
agentId: "vercel-ai-agent",
serverName: "my-server",
startedAt: Date.now(),
destructive: false,
}
return proxy.run(ctx, async () => {
const result = await yourActualTool(args)
return { content: [{ type: "text", text: JSON.stringify(result) }] }
})
}Mastra
Add full ops middleware to any Mastra MCP server.
Mastrats
import { createMCPProxy, observe } from "@businys/ops"
// Wrap Mastra's MCP handler
const proxy = createMCPProxy()
const ops = await observe({ port: 3100 })
// In your Mastra MCP server's tool handler
export async function handleTool(toolName: string, input: unknown, agentId: string) {
const ctx = {
toolName,
toolGroup: toolName.split("_")[0] ?? toolName,
toolTier: "kit" as const,
method: "tools/call",
path: "/tools/call",
input: input as Record<string, unknown>,
agentId,
serverName: "mastra-server",
startedAt: Date.now(),
destructive: false,
}
return proxy.run(ctx, () => mastraToolHandler(toolName, input))
}OpenAI Agents SDK
Bridge any OpenAI Agents SDK tool server with full middleware.
OpenAI Agents SDKsh/yaml
# Use the CLI bridge — no code changes to your server
npx @businys/ops bridge node ./openai-agents-server.js --port 3100
# Point your agent at http://localhost:3100 instead of the server directlyLangChain
Wrap LangChain tools with rate limiting, audit logging, and observability.
LangChaints
import { createMCPProxy } from "@businys/ops"
const proxy = createMCPProxy({
rateLimit: { globalMax: 200, windowMs: 60_000 },
})
// Wrap any LangChain tool.call
const originalCall = tool.call.bind(tool)
tool.call = async (input, config) => {
const ctx = {
toolName: tool.name,
toolGroup: tool.name.split("_")[0] ?? tool.name,
toolTier: "kit" as const,
method: "tools/call",
path: "/tools/call",
input: input as Record<string, unknown>,
agentId: config?.runId ?? "langchain-agent",
serverName: "langchain",
startedAt: Date.now(),
destructive: false,
}
const result = await proxy.run(ctx, () => originalCall(input, config))
return JSON.parse(result.content[0]?.text ?? "{}")
}Any stdio serverNo code required
Wrap any stdio MCP server — Claude, GPT-4, or custom — as a managed HTTP endpoint.
Any stdio serversh/yaml
# Zero-code bridge for any stdio MCP server
npx @businys/ops bridge node ./my-stdio-server.js
# With options
npx @businys/ops bridge python server.py \
--port 3200 \
--rate-limit 50 \
--name "my-python-server"
# The bridge endpoint at http://localhost:3200 now has:
# - Rate limiting (50 calls/min/agent)
# - Reputation scoring
# - Audit logging
# - Confirmation for destructive callsGitHub Actions
Run Observer Mode in CI to capture every tool call during tests.
GitHub Actionssh/yaml
# .github/workflows/test.yml
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Install
run: npm ci
- name: Start Observer Mode
run: npx @businys/ops observe --port 3100 &
- name: Run tests
run: npm test
env:
MCP_OPS_URL: http://localhost:3100
- name: Print call stats
run: npx @businys/ops status --port 3100