Create a local MCP-server executable package

Create a local executable MCP-server package referenced by an integration with source.kind: "local". For an upstream-hosted MCP endpoint, create an integration package with source.kind: "remote" instead.

POST/api/packages/mcp-servers

Authorization

better-auth.session_token<token>

Cookie session from Better Auth. Requires X-Org-Id header for org-scoped routes.

In: cookie

Header Parameters

X-Org-Id?string

Organization ID. Required for cookie auth. Not needed for API key auth (org resolved from key).

Formatuuid
X-Space-Id?string

Space ID. Required for space-scoped routes (agents, runs, schedules, and space-scoped module routes). Not needed for API key auth (space resolved from key).

Request Body

multipart/form-data

Upload a self-contained package archive (multipart/form-data with a .afps/.zip file). The package ID is derived from the file name. The archive must contain a valid manifest.json and the file referenced by server.entry_point; JSON manifest-only creation is refused with 415 archive_required.

curl -X POST "https://your-instance/api/packages/mcp-servers" \  -F file="string"
{
  "id": "string",
  "orgId": "string",
  "name": "string",
  "description": "string",
  "definition": "draft",
  "content": "string",
  "source": "local",
  "created_by": "string",
  "auto_installed": true,
  "version": "string",
  "manifest": {},
  "manifest_name": "string",
  "version_count": 0,
  "has_unarchived_changes": true,
  "forked_from": "string",
  "home_space_id": "string",
  "home_writable": true,
  "home_deletable": true,
  "home_shareable": true,
  "agents": [
    {
      "id": "string",
      "display_name": "string"
    }
  ],
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z"
}

{
  "type": "https://docs.appstrate.dev/errors/validation-failed",
  "title": "Validation Failed",
  "status": 400,
  "detail": "name: Invalid input: expected string, received undefined (+2 more)",
  "code": "validation_failed",
  "request_id": "req_abc123",
  "errors": [
    {
      "field": "name",
      "code": "required",
      "message": "Invalid input: expected string, received undefined"
    },
    {
      "field": "email",
      "code": "invalid_format",
      "message": "Invalid email address"
    },
    {
      "field": "age",
      "code": "invalid_type",
      "message": "Invalid input: expected number, received string"
    }
  ]
}

{
  "type": "https://docs.appstrate.dev/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Invalid or missing session",
  "code": "unauthorized",
  "request_id": "req_abc123"
}
{
  "type": "https://docs.appstrate.dev/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "Insufficient permissions",
  "code": "forbidden",
  "request_id": "req_abc123"
}
{
  "type": "http://example.com",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "code": "string",
  "request_id": "string",
  "param": "string",
  "retry_after": 0,
  "errors": [
    {
      "field": "string",
      "code": "string",
      "message": "string",
      "title": "string",
      "candidate_connections": [
        {
          "id": "string",
          "label": "string",
          "account_id": "string",
          "owned_by_actor": true,
          "needs_reconnection": true
        }
      ],
      "connection_id": "string",
      "missing_scopes": [
        "string"
      ],
      "owned_by_actor": true,
      "required_scopes": [
        "string"
      ],
      "auth_key": "string",
      "required_auth_key": "string",
      "available_auth_keys": [
        "string"
      ],
      "connect_url": "http://example.com",
      "expiresAt": "2019-08-24T14:15:22Z",
      "packageId": "string"
    }
  ]
}
{
  "type": "https://docs.appstrate.dev/errors/archive-required",
  "title": "Archive Required",
  "status": 415,
  "detail": "MCP-server packages must be uploaded as a multipart .afps or .zip archive.",
  "code": "archive_required",
  "request_id": "req_abc123"
}