@bootstrapp/claude
v0.1.1
Published
Claude Code SDK integration for Bootstrapp
Downloads
115
Maintainers
Readme
@bootstrapp/claude
Claude Code SDK integration for Bootstrapp applications. Provides a bridge server for connecting Claude agents to your Bootstrapp projects with MCP (Model Context Protocol) tool support.
Installation
npm install @bootstrapp/claudeFeatures
- Bridge server for Claude Agent SDK integration
- MCP tool discovery and management
- Session-based conversations with streaming responses
- Permission management for tool execution
- Question/answer flow for interactive agents
CLI Usage
Start the Bridge Server
bootstrapp claude:bridge [options]Options:
| Option | Description | Default |
|--------|-------------|---------|
| --port <number> | Port to listen on | 8765 |
| --host <string> | Host to bind to | localhost |
| --model <string> | Default Claude model | claude-sonnet-4-5-20250929 |
| --project <path> | Project directory | Current directory |
| --dev-port <number> | Dev server port for MCP tools | 1315 |
Example:
bootstrapp claude:bridge --port 8080 --model claude-sonnet-4-5-20250929API Reference
Provider (@bootstrapp/claude/provider)
The provider adapts messages for Claude Agent SDK:
import { claudeAgentProvider } from "@bootstrapp/claude/provider";
// Provider interface
const provider = {
type: "claude-code",
adaptMessages: (messages) => string,
adaptTools: (tools) => tools,
adaptResponse: (res) => res,
streamAPI: async function* ({ provider, model, messages }) { ... },
processStream: async function* (stream) { ... },
};Transport (@bootstrapp/claude/transport)
The transport plugin creates HTTP connections to the bridge server:
import claudeTransport from "@bootstrapp/claude/transport";
// Initialize with a host that has a transports registry
claudeTransport.initialize(host);
// Create a transport instance
const transport = await host.transports.get("claude-code").createTransport({
baseUrl: "http://localhost:8765"
});
// Use the transport
const session = await transport.createSession({ model: "claude-sonnet-4-5-20250929" });
await transport.send(session.sessionId, "Hello!");
for await (const message of transport.receive(session.sessionId)) {
console.log(message);
}
await transport.close(session.sessionId);Transport Methods
| Method | Description |
|--------|-------------|
| createSession(options) | Create a new conversation session |
| send(sessionId, message) | Send a message to the session |
| receive(sessionId) | Async generator yielding responses |
| close(sessionId) | Close and cleanup a session |
| resumeSession(sessionId, options) | Resume an existing session |
| health() | Check bridge server health |
Bridge Server HTTP API
Endpoints
| Method | Path | Description |
|--------|------|-------------|
| POST | /session | Create new session |
| POST | /send | Send message to session |
| GET | /receive/:sessionId | SSE stream for responses |
| DELETE | /session/:sessionId | Close session |
| GET | /health | Health check |
| POST | /permission | Approve/deny tool permissions |
| POST | /question | Answer agent questions |
| GET | /mcp/tools | List available MCP tools |
| GET | /mcp/resources | List MCP resources |
| POST | /mcp/config | Configure tool availability |
SSE Events
The /receive/:sessionId endpoint streams the following events:
assistant- Text content from Claudetool_use- Tool execution requeststool_result- Tool execution resultspermission_request- Tool permission requestsquestion_request- Agent questionsdone- Conversation turn completeerror- Error occurred
Project Configuration
Configure the bridge in your project's package.json:
{
"settings": {
"agent": {
"port": 8765,
"hostname": "localhost",
"model": "claude-sonnet-4-5-20250929"
}
}
}Requirements
- Node.js >= 18.0.0
@anthropic-ai/claude-agent-sdk(peer dependency, auto-installed by CLI)@bootstrapp/mcpfor MCP tool support
License
AGPL-3.0
