@setbase/mcp
v0.2.0
Published
Model Context Protocol server for Setbase
Maintainers
Readme
@setbase/mcp
Model Context Protocol (MCP) server for Setbase. Enables AI agents to interact with Setbase for infrastructure management.
Overview
The Setbase MCP server provides a set of tools that AI assistants can use to:
- Create and initialize projects
- Provision infrastructure resources
- Deploy applications
- Manage environment variables
- Monitor project status
- Destroy resources
Installation
pnpm install @setbase/mcpUsage
As an MCP Server
The MCP server communicates via stdio and can be integrated with MCP-compatible clients like Claude Desktop.
Claude Desktop Configuration
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"setbase": {
"command": "node",
"args": ["/path/to/setbase/packages/mcp/dist/index.js"]
}
}
}Or if installed globally:
{
"mcpServers": {
"setbase": {
"command": "setbase-mcp"
}
}
}Programmatic Usage
import { startServer } from '@setbase/mcp';
// Start the MCP server
await startServer();Available Tools
create_project
Initialize a new Setbase project with infrastructure resources.
Parameters:
name(string, required): Project nameruntime(string, required): Runtime environment (node, python, go)framework(string, optional): Frameworkresources(object, optional): Resources to provision (database, cache, storage, email)deployment(object, optional): Deployment configuration
Example:
{
"name": "my-saas",
"runtime": "node",
"framework": "next",
"resources": {
"database": {
"provider": "neon",
"config": { "region": "us-east-1" }
}
}
}provision_resources
Provision resources defined in the project manifest.
Parameters:
force(boolean, optional): Force re-provisioning
deploy_project
Deploy the project to a specified environment.
Parameters:
environment(string, optional): Deployment environment (development, staging, production)force(boolean, optional): Force deploymentskipBuild(boolean, optional): Skip build step
get_env
Get environment variables for the project.
Parameters:
environment(string, optional): Environment name (default: development)format(string, optional): Output format (env, json)
get_status
Get the current status of the project, resources, and deployments.
Parameters:
verbose(boolean, optional): Include detailed resource information
destroy_project
Destroy all provisioned resources.
Parameters:
confirm(boolean, required): Confirmation to destroy (must be true)keepState(boolean, optional): Keep state files after destruction
Environment Variables
SETBASE_PASSWORD: Password for encrypting credentials (optional)
Example Conversation with AI
User: Create a new Next.js project with a Postgres database and Redis cache
AI: I'll create that for you using Setbase.
[Calls create_project tool with appropriate configuration]
User: Deploy it to production
AI: I'll deploy your project to production.
[Calls deploy_project tool with environment: "production"]
User: Get the environment variables
AI: Here are your environment variables.
[Calls get_env tool and displays the results]How It Works
The MCP server:
- Listens for tool calls from MCP clients (like Claude Desktop)
- Executes the requested operations using Setbase's core orchestrators
- Returns structured JSON responses to the client
- Maintains project state in
.setbase/directory
Security
- Credentials are encrypted using AES-256-GCM
- State files are stored locally in
.setbase/directory - The server runs in the context of the current working directory
- All destructive operations require explicit confirmation
Development
# Build the package
pnpm build
# Watch mode
pnpm dev
# Run tests
pnpm test
# Lint
pnpm lintArchitecture
┌─────────────┐
│ MCP Client │ (Claude Desktop, etc.)
└──────┬──────┘
│ stdio
┌──────▼──────┐
│ MCP Server │ (this package)
└──────┬──────┘
│
┌──────▼──────┐
│ Tools │ (create_project, deploy, etc.)
└──────┬──────┘
│
┌──────▼──────┐
│ Context │ (orchestrators, state)
└──────┬──────┘
│
┌──────▼──────┐
│ @setbase/ │ (core package)
│ core │
└─────────────┘License
MIT
