Other sections: Quick start · Overview · Tools reference
Problem: AI agents (Google Studio, Cursor) cannot create projects without prior user registration.
Solution: projects.create_project_anonymous
- ✅ No authentication required
- ✅ Automatically creates an anonymous user with
is_anonymous: true - ✅ Generates API key with prefix
anon_ask_(ANONYMOUS tier) - ✅ Returns
user_api_key,project_api_key,session_token,user_id - ✅ User is immediately authenticated and ready to use
- ✅ Lets you start working with the project right away
- 1 project max (cannot create more)
- 1 API key (cannot create more)
- 1,000 Logic Engine calls/month (vs 10,000 on FREE)
- 20 MB JSON storage (vs 100 MB on FREE)
- 20 triggers (vs 50 on FREE)
- Payments disabled
Conversion:
- Use
auth.convert_anonymous_userto convert to FREE tier - After conversion all limits increase to FREE tier
Usage:
{
"tool": "projects.create_project_anonymous",
"params": {
"name": "Test Project",
"description": "Created by AI agent"
}
}Problem: Anonymous projects need to be linked to a real user.
Solution: projects.attach_to_user
- ✅ Requires authorization (new owner's user_id)
- ✅ Validates
auth_keyfrom anonymous creation - ✅ Transfer ownership:
- Updates
project.user_id - Creates records in
data_projects_user - Removes old anonymous key
- Creates new key for the owner
- Updates
Usage:
{
"tool": "projects.attach_to_user",
"params": {
"project_id": 1025,
"auth_key": "ask_...",
"user_id": 123
}
}Project user management (add_user, remove_user) requires a Professional subscription.
Implementation:
- Check at API endpoint level (
agentstack-core/endpoints/projects_endpoints.py) - Uses
SubscriptionService.get_user_subscription() - Checks
plan_typein ['pro', 'professional', 'enterprise'] - Returns 403 Forbidden when subscription is missing
- Error is passed through MCP unchanged
Error:
{
"success": false,
"error": "HTTP 403: Professional subscription required for adding/removing project users. Please upgrade your subscription."
}Architecture:
ProjectsSDKWrapper— wrapper over HTTP API- Uses
shared.clients.http.requestfor requests - Unified interface for all operations
- Automatic header building (Authorization, X-Project-ID)
- Uses existing endpoints (no duplicated logic)
Details:
- API keys managed via
/api/apikeys/keys(no duplicates) - Settings read from project
config - Activity from
/api/projects/{id}/logs
Strategy:
- SDK/API errors are passed through as-is
- HTTP status codes are not converted
trace_idkept for debugging- Uses
httpx.HTTPStatusErrorfor HTTP errors
Error format:
{
"success": false,
"error": "HTTP 403: Insufficient permissions",
"trace_id": "uuid"
}Pydantic models:
- All new project methods use Pydantic models
- Automatic parameter validation
- Type-safe interface
Example:
class CreateProjectRequest(BaseModel):
name: str
description: Optional[str] = None
config: Optional[Dict[str, Any]] = None
...Support:
- Check
demo_context.is_readonly() - Block write operations in read-only mode
- Check capabilities via
DemoCapabilities
curl -X POST https://agentstack.tech/mcp/tools/projects.create_project_anonymous \
-H "Content-Type: application/json" \
-d '{
"tool": "projects.create_project_anonymous",
"params": {
"name": "My AI Project",
"description": "Created by AI agent"
}
}'Response:
{
"success": true,
"data": {
"project_id": 1025,
"api_key": "ask_abc123...",
"auth_key": "ask_abc123...",
"project": {
"id": 1025,
"name": "My AI Project",
...
}
},
"trace_id": "uuid"
}curl -X POST https://agentstack.tech/mcp/tools/projects.attach_to_user \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"tool": "projects.attach_to_user",
"params": {
"project_id": 1025,
"auth_key": "ask_abc123...",
"user_id": 123
}
}'Response:
{
"success": true,
"data": {
"success": true,
"project_id": 1025,
"new_api_key": "ask_xyz789...",
"message": "Project 1025 successfully attached to user 123"
},
"trace_id": "uuid"
}curl -X POST https://agentstack.tech/mcp/tools/projects.get_projects \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"tool": "projects.get_projects",
"params": {
"is_active": true,
"limit": 10
}
}'curl -X POST https://agentstack.tech/mcp/tools/projects.add_user \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"tool": "projects.add_user",
"params": {
"project_id": 1025,
"email": "user@example.com",
"role": "member"
}
}'When subscription is missing:
{
"success": false,
"error": "HTTP 403: Professional subscription required for adding/removing project users. Please upgrade your subscription.",
"trace_id": "uuid"
}curl -X POST https://agentstack.tech/mcp/tools/projects.create_project/stream \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{
"tool": "projects.create_project",
"params": {
"name": "Streaming Project"
}
}'Response (SSE):
data: {"status": "started", "trace_id": "uuid"}
data: {"status": "processing", "progress": 50}
data: {"status": "completed", "result": {...}}
- Auth: 4 tools
- Projects: 8 tools
- Logic Engine: 9 tools
- Processors: 3 tools
- Commands: 2 tools
- Payments: 4 tools
- Scheduler: 11 tools ⭐ (largest category)
- Analytics: 2 tools
- API Keys: 3 tools
- Buffs: 10 tools
- Assets: 4 tools
Total: 1 tool (agentstack.execute), 60+ actions — action list: GET /mcp/actions
- ✅ Anonymous project creation
- ✅ Attach projects to users
- ✅ Full project management methods
- ✅ Integration with existing endpoints
- ✅ Subscription check for user management
The MCP server provides full access to all AgentStack functionality through a single interface. Focus areas:
- AI agent convenience (anonymous creation)
- Flexibility (project attachment)
- Security (subscription checks, validation)
- Reliability (error handling, trace_id)
- Performance (streaming, caching)
All tools use existing endpoints, ensuring consistency and no code duplication.
Document version: 1.0
Last updated: 2025-01-29
Author: AgentStack Development Team