@dfinity/caffeine-mcp-server
MCP (Model Context Protocol) server for Caffeine AI tools. This package provides a set of tools for interacting with Caffeine AI projects through the Model Context Protocol.
Features
- Deploy projects to public domains
- Manage project files (push/pull)
- Set project names
- Create new projects
- Get project information
- And more...
Available Tools
caffeine_create_project
Create a new project with an initial prompt. The workspace folder must be empty.
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
- initialPrompt (string, required): The initial prompt to create the project with
Response:
{
projectId: string;
}
caffeine_deploy
Deploy the project to a public domain (lasts 45 minutes)
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
Response:
{
ok?: {
url: string,
output: {
frontend_canister_id: string,
frontend_timestamp: string,
backend_canister_id: string,
backend_timestamp: string
},
github?: {
githubId: number,
githubHtmlUrl: string
},
saveFailed?: boolean
},
error?: {
message: string,
code: DeployErrorCode,
location: "frontend" | "backend" | "github" | "general"
}
}
Important Notes:
- Only deploys files that are on the caffeine server
- To deploy local changes, push files first using push_files
caffeine_download
Download a project into a new folder.
Inputs:
- projectId (string, required): The ID of the project to download
- workspaceFolder (string, required): The target folder where the project will be downloaded
- clone (boolean, required): If true, creates a copy of the project before downloading. Must be true if the project is not owned by the user.
caffeine_get_project
Get full project details including files and the whole event log ("Initialize", "Prompt", "Deploy").
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
caffeine_get_project_metadata
Get metadata for the current project. This includes the initalPrompt, a url to the caffeine web chat of the project and last modification information.
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
Important Notes:
- Prefer this tool over get_project if the desired information is available here. This response is much smaller
caffeine_get_projects
Get a list of projects (own or featured)
Inputs:
- type (enum, required): Type of projects to fetch ('own' or 'featured')
Response:
{
count: string,
countTotal: string,
rows: Array<{
id: string,
name: string,
userId: string,
featured: boolean,
initialPrompt: string,
backendCanisterId: string,
frontendCanisterId: string,
deploymentCount: number,
githubUrl: string | null,
deploymentUrl: string | null,
url: string | null,
category: string,
systemPrompt: string,
createdAt: Date
}>
}
Important Notes:
- 'own' type requires authentication
- 'featured' type returns publicly available projects
caffeine_pull_files
Pull files from Caffeine server and write them to local workspace
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
- overwrite_local_changes (boolean, optional): Whether to overwrite local changes
Response:
{
pulledFiles: string[],
metadata: {
projectEventId: string,
createdAt: number
}
}
Important Notes:
- Never set overwrite_local_changes to true without explicit user confirmation
- If user agrees to overwrite local changes, set to true once, then false for subsequent calls
- Uses gitignore for file filtering
caffeine_push_files
Push files from workspace to Caffeine backend
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
Response:
{
success: boolean,
pushedFiles: string[],
}
Important Notes:
- Automatically filters files using gitignore
- Only pushes modified files since last synchronization
caffeine_set_project_name
Set the name of the project in the Caffeine API
Inputs:
- workspaceFolder (string, required): The root folder of the local copy of the caffeine project. The folder must contain a caffeine.json file with a projectId.
- name (string, required): The new name for the project
Response:
{
ok?: {
projectName: string
},
error?: string
}
Configuration
1. Generating your API Key here
2. Usage with Cline or Claude Desktop
Add this to your cline_mcp_settings.json
or claude_desktop_config.json
:
{
"mcpServers": {
"@dfinity/caffeine-mcp-server": {
"command": "npx",
"args": [
"@dfinity/caffeine-mcp-server"
],
"env": {
"CAFFEINE_API_KEY": "{your_api_key}",
"CAFFEINE_BASE_URL": "https://caffeine.ai"
},
"autoApprove": [
"caffeine_deploy",
"caffeine_get_projects",
"caffeine_get_project_metadata"
]
}
}
}
Development
- Clone the repository
- Install dependencies:
npm install
npm run build
- Run the MCP inspector for development:
npm run inspector
License
MIT