Turn your existing system into an AI-agent-ready platform β in seconds.
AgentBridge discovers capabilities from your API schemas, database schemas, and source routes, then generates a complete Agent Integration Kit that works with MCP, Claude, OpenAI, and Vercel AI SDK out of the box.
With built-in Claude Agent SDK support and AI-powered dynamic generation, AgentBridge goes beyond static templates β it uses AI to craft richer tool definitions, domain-specific skills, and intelligent prompts tailored to your system.
- β¨ Features
- π Quick Start
- π CLI Reference
- π What AgentBridge Discovers
- π Generated Kit Layout
- π€ AI-Powered Generation
- π‘οΈ Safety Model
- ποΈ Architecture
- π§© Extending AgentBridge
- π¦ Publishing & Installation
- π€ Contributing
- π License
|
π Auto-discovery Extracts capabilities from OpenAPI, GraphQL, SQL, and source code routes (Python/Flask/FastAPI, JS/Express, Java/Spring) |
π§ Multi-format Generation Outputs MCP, Claude, OpenAI, and Vercel AI SDK tool definitions simultaneously |
|
π€ AI-Powered Generation Uses Claude Agent SDK (primary) or Anthropic API (fallback) to dynamically generate tools, skills, and prompts |
π§ Agent as a Service Runs as an interactive agent for your existing project via Claude Agent SDK |
|
π‘οΈ Safety-first Classifies operations by risk level with human-in-the-loop confirmation for dangerous actions |
π§ͺ Dry-run Validation Test tool invocations against generated guardrails before executing |
|
π Custom LLM Providers Supports DeepSeek, OpenRouter, and any Anthropic-compatible endpoint |
πͺΆ Rules + LLM Combined Rule-based analysis (risk keywords, HTTP verbs) feeds into LLM as context for smarter generation |
pip install agbrπ¦ Install with optional features
# AI-powered generation + agent sessions (recommended)
pip install "agbr[agent]"
# Lightweight AI generation (no Claude Agent SDK)
pip install "agbr[ai]"
# Everything
pip install "agbr[all]"
# Install from source (for development)
git clone git@github.com:jastfkjg/AgentBridge.git
cd AgentBridge
pip install -e ".[all]"AgentBridge requires an LLM API key for all generation. By default it uses Anthropic's Claude, but you can configure any Anthropic-compatible provider:
# Required
export ANTHROPIC_API_KEY="sk-ant-..."
# Optional: Custom API endpoint
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic" # DeepSeek
# export ANTHROPIC_BASE_URL="https://openrouter.ai/api/v1" # OpenRouter
# Optional: Custom model name
export ANTHROPIC_MODEL="deepseek-v4-flash"π Or pass via CLI flags
agentbridge generate examples/writing_system --output build/kit \
--api-key "sk-..." \
--base-url "https://api.deepseek.com/anthropic" \
--model "deepseek-v4-flash"Note: When
ANTHROPIC_BASE_URLis set, AgentBridge automatically uses theanthropicSDK backend (notclaude-agent-sdk) for generation, since custom endpoints are not supported by the agent SDK.
# Requires ANTHROPIC_API_KEY (set via env var or --api-key flag)
agentbridge generate examples/writing_system --output .agentbridge/writing-kitagentbridge chat .agentbridge/writing-kitPYTHONPATH=src python -m unittest discover -s tests| Command | Description |
|---|---|
agentbridge discover <paths> |
Discover and print capabilities as JSON |
agentbridge generate <paths> -o <dir> |
Generate an Agent Integration Kit |
agentbridge dry-run <kit> <tool> |
Dry-run a tool invocation |
agentbridge chat <kit> |
Start an interactive AI agent session |
π Full command details
agentbridge discover examples/writing_systemagentbridge generate examples/writing_system --output build/agent-kit
# With custom name
agentbridge generate examples/writing_system --output build/agent-kit --name my-kit
# With custom LLM provider
agentbridge generate examples/writing_system --output build/agent-kit \
--api-key "sk-..." --base-url "https://api.deepseek.com/anthropic" --model "deepseek-v4-flash"# Normal invocation
agentbridge dry-run build/agent-kit create_chapter --args '{"project_id":"p1","title":"Opening"}'
# High-risk operation (requires confirmation)
agentbridge dry-run build/agent-kit delete_character \
--args '{"project_id":"p1","character_id":"c1"}' --confirmedagentbridge chat build/agent-kit
# Or with custom LLM provider:
agentbridge chat build/agent-kit --api-key "sk-..." --base-url "https://api.deepseek.com/anthropic"| Source Type | Formats |
|---|---|
| π API Schemas | OpenAPI JSON/YAML, GraphQL schemas |
| ποΈ Database Schemas | SQL CREATE TABLE statements |
| π Python Routes | FastAPI @router.get/post/..., Flask @app.route |
| π JavaScript Routes | Express app.get/post/... |
| β Java Routes | Spring @GetMapping/@PostMapping/... |
All sources are normalized into a common capability model with:
| Field | Description |
|---|---|
domain + resource |
Logical grouping |
action |
What the capability does |
input_schema |
JSON Schema parameters |
risk |
read / write / destructive / external_side_effect |
confirm_required |
Whether human approval is needed |
source |
Full traceability back to the origin file |
agent-kit/
βββ manifest.json # Kit metadata and summary
βββ capabilities.json # All discovered capabilities
βββ tools/
β βββ mcp_tools.json # MCP tool definitions
β βββ openai_tools.json # OpenAI function calling format
β βββ claude_tools.json # Claude tool use format
β βββ vercel_ai_tools.ts # Vercel AI SDK TypeScript tools
βββ skills/
β βββ writing.md # Domain-specific skill definitions
βββ prompts/
β βββ system.md # Agent system prompt
βββ resources/
β βββ schema.json # Resource schema summary
βββ guardrails/
β βββ permissions.json # Risk policy and confirmation rules
βββ tests/
β βββ tool_invocation_tests.json # Auto-generated invocation tests
β βββ test_generated_tools.py # Python unit tests for tool contracts
βββ dry_run_plan.json # Dry-run execution plan
AgentBridge uses LLM to generate all content β tool descriptions, skills, system prompts, risk assessments, and inferred tools. Rule-based analysis (keyword matching, HTTP verb classification) is fed into the LLM as context, not used directly.
| What | Description |
|---|---|
| π Enhanced tool descriptions | Context-aware descriptions that capture business semantics |
| π― Domain-specific skills | Workflow prompts tailored to your domain with best practices |
| π§ Intelligent system prompts | Prompts that understand resource relationships and suggest safe sequences |
| π Inferred additional tools | Tools implied by your schema but not explicitly present |
| LLM evaluates risk with rule-based hints as context |
| Backend | Package | Use Case |
|---|---|---|
| Claude Agent SDK (primary) | claude-agent-sdk |
Generation + interactive agent sessions |
| Anthropic API (fallback) | anthropic |
Generation only, supports custom endpoints |
When claude-agent-sdk is installed and no custom ANTHROPIC_BASE_URL is set, it is used automatically. When a custom endpoint is configured or claude-agent-sdk is not installed, the anthropic SDK is used.
from pathlib import Path
from agentbridge.generator import AgentKitGenerator
from agentbridge.agent import AIGenerator, AgentRunner
# Generate with default provider (Anthropic Claude)
ai = AIGenerator(api_key="sk-ant-...")
kit = AgentKitGenerator(ai_generator=ai).generate(
[Path("examples/writing_system")],
Path("build/agent-kit"),
)
# Custom LLM provider (e.g., DeepSeek)
ai = AIGenerator(
api_key="sk-d831ecabc21842fdae6f30c24dd3b052",
base_url="https://api.deepseek.com/anthropic",
model="deepseek-v4-flash",
)
# Agent session
import asyncio
async def main():
runner = AgentRunner(kit_dir="build/agent-kit", api_key="sk-ant-...")
async for message in runner.query("List all chapters in project p1"):
print(message)
asyncio.run(main())| Risk Level | Confirmation | Examples |
|---|---|---|
π’ read |
Not required | GET, list, search, find |
π‘ write |
Optional by policy | POST, create, update, rewrite |
π΄ destructive |
Required | DELETE, remove, destroy, drop, cancel |
π external_side_effect |
Required | publish, send, email, pay, deploy, export |
The safety model is applied consistently. Rule-based risk classification provides initial context, and the LLM may override when justified.
βββββββββββββββ ββββββββββββββββ βββββββββββββββββββ
β Discovery ββββββΆβ Generator ββββββΆβ Agent Kit β
β (schemas, β β (LLM-driven β β (tools, skills,β
β routes, β β + rules as β β prompts, β
β SQL) β β context) β β guardrails) β
βββββββββββββββ ββββββββ¬ββββββββ ββββββββββ¬βββββββββ
β β
ββββββββΌββββββββ ββββββββΌβββββββββ
β AI Generatorβ β Agent Runner β
β (Claude SDK β β (Claude SDK β
β / Anthropicβ β Client + β
β API) β β MCP Tools) β
ββββββββββββββββ βββββββββββββββββ
| Extension | How |
|---|---|
| New schema parser | Implement a discoverer in discovery.py |
| New tool format | Add a builder function in generator.py |
| Custom AI prompts | Override prompts in agent.py |
| Custom risk policy | Modify policy.py |
| Custom agent tools | Extend AgentRunner._build_kit_tools() |
π§ How does `pip install "agbr"` work?
AgentBridge is packaged as a standard Python package using pyproject.toml + setuptools. Here's the mechanism:
AgentBridge/
βββ pyproject.toml # Package metadata, dependencies, entry points
βββ src/
β βββ agentbridge/ # Actual Python package
β βββ __init__.py
β βββ cli.py # CLI entry point
β βββ agent.py
β βββ generator.py
β βββ ...
βββ tests/
[project]
name = "agbr" # pip install agbr
version = "0.2.0"
[project.optional-dependencies] # pip install "agbr[agent]"
agent = ["claude-agent-sdk>=0.1.0"]
ai = ["anthropic>=0.30.0"]
[project.scripts]
agentbridge = "agentbridge.cli:main" # CLI entry point
[tool.setuptools.packages.find]
where = ["src"] # Code lives in src/- Build:
pipreadspyproject.toml, usessetuptoolsto build a wheel (.whl) - Install: The wheel is installed into your Python environment's
site-packages/ - CLI: The
[project.scripts]section creates aagentbridgeexecutable in your PATH that callsagentbridge.cli:main
# Build the package
pip install build
python -m build
# Upload to TestPyPI (for testing)
pip install twine
twine upload --repository testpypi dist/*
# Upload to PyPI (for real)
twine upload dist/*After publishing, anyone can run pip install "agbr".
Until the package is published on PyPI, users can install it in these ways:
# Install from local source (editable mode, for development)
pip install -e .
# Install from GitHub repository
pip install git+ssh://git@github.com/jastfkjg/AgentBridge.git
# Install from a local wheel
pip install dist/agentbridge-0.2.0-py3-none-any.whlContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please make sure tests pass:
PYTHONPATH=src python -m unittest discover -s tests -vThis project is licensed under the MIT License β see the LICENSE file for details.