eavz

MCP Servers

Create and manage Model Context Protocol (MCP) servers.

MCP Servers

MCP servers expose integration actions as tools for AI agents via the Model Context Protocol. Each server has its own bearer token and endpoint URL that can be used with any MCP-compatible client.

Servers operate in two modes:

  • TOOLS — each integration action is exposed as an individual tool
  • CODE — meta-tools let AI agents write code to orchestrate multiple actions

List MCP Servers

GET/api/v1/mcp/servers

List all MCP servers in your organization.

Response

json
{
  "servers": [
    {
      "id": "abc123def456",
      "orgId": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Sales Tools",
      "description": "CRM and email integrations",
      "mode": "TOOLS",
      "endUserId": null,
      "createdBy": "user123",
      "createdAt": "2025-01-15T10:30:00.000Z",
      "updatedAt": "2025-01-15T10:30:00.000Z",
      "mcpEndpoint": "https://api.weavz.io/mcp/srv_abc123def456"
    }
  ],
  "total": 1
}

Example

bash
curl https://api.weavz.io/api/v1/mcp/servers \
  -H "Authorization: Bearer wvz_your_api_key"

Create MCP Server

POST/api/v1/mcp/servers

Create a new MCP server. The response includes a bearerToken that MCP clients use to authenticate — this is only shown once.

Request Body

FieldTypeRequiredDescription
namestringYesServer name
descriptionstringNoServer description
workspaceIdstring (uuid)YesAssociate with a workspace
modestringNoServer mode: TOOLS or CODE (default: TOOLS)
endUserIdstringNoScope the server to an end user. Connections resolve to this user's accounts.

Response (201)

json
{
  "server": {
    "id": "abc123def456",
    "orgId": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Sales Tools",
    "description": "CRM and email integrations",
    "mode": "TOOLS",
    "endUserId": null,
    "createdBy": "user123",
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T10:30:00.000Z",
    "mcpEndpoint": "https://api.weavz.io/mcp/srv_abc123def456"
  },
  "bearerToken": "mcp_abc123...",
  "mcpEndpoint": "https://api.weavz.io/mcp/srv_abc123def456"
}

Example

bash
curl -X POST https://api.weavz.io/api/v1/mcp/servers \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Sales Tools",
    "description": "CRM and email integrations",
    "workspaceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "mode": "TOOLS"
  }'

Errors

StatusCodeDescription
400VALIDATION_ERRORMissing server name
403QUOTA_EXCEEDEDMCP server limit reached

Get MCP Server

GET/api/v1/mcp/servers/:id

Get server details including its configured tools.

Path Parameters

FieldTypeDescription
idstringServer ID

Response

json
{
  "server": {
    "id": "abc123def456",
    "orgId": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Sales Tools",
    "mode": "TOOLS",
    "endUserId": null,
    "createdAt": "2025-01-15T10:30:00.000Z",
    "updatedAt": "2025-01-15T10:30:00.000Z",
    "mcpEndpoint": "https://api.weavz.io/mcp/srv_abc123def456"
  },
  "tools": [
    {
      "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
      "mcpServerId": "abc123def456",
      "integrationName": "slack",
      "integrationAlias": "slack",
      "actionName": "send_channel_message",
      "toolType": "ACTION",
      "connectionId": "c1d2e3f4-5678-90ab-cdef-1234567890ab",
      "displayName": null,
      "description": null,
      "inputDefaults": null,
      "sortOrder": 0
    }
  ]
}

Example

bash
curl https://api.weavz.io/api/v1/mcp/servers/abc123def456 \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDMCP server not found

Update MCP Server

PATCH/api/v1/mcp/servers/:id

Update server properties.

Path Parameters

FieldTypeDescription
idstringServer ID

Request Body

FieldTypeRequiredDescription
namestringNoServer name
descriptionstringNoServer description
modestringNoTOOLS or CODE
endUserIdstring | nullNoScope to an end user, or null to remove

Response

json
{
  "server": {
    "id": "abc123def456",
    "name": "Updated Name",
    "mode": "CODE",
    "updatedAt": "2025-01-16T14:00:00.000Z"
  }
}

Example

bash
curl -X PATCH https://api.weavz.io/api/v1/mcp/servers/abc123def456 \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated Name", "mode": "CODE"}'

Errors

StatusCodeDescription
404NOT_FOUNDMCP server not found

Delete MCP Server

DELETE/api/v1/mcp/servers/:id

Delete an MCP server and all its tools.

Path Parameters

FieldTypeDescription
idstringServer ID

Response

json
{
  "deleted": true,
  "id": "abc123def456"
}

Example

bash
curl -X DELETE https://api.weavz.io/api/v1/mcp/servers/abc123def456 \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDMCP server not found

Regenerate Token

POST/api/v1/mcp/servers/:id/regenerate-token

Regenerate the MCP bearer token. The old token is immediately invalidated.

Path Parameters

FieldTypeDescription
idstringServer ID

Response

json
{
  "bearerToken": "mcp_new_token_here...",
  "mcpEndpoint": "https://api.weavz.io/mcp/srv_abc123def456"
}

Example

bash
curl -X POST https://api.weavz.io/api/v1/mcp/servers/abc123def456/regenerate-token \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDMCP server not found

Add Tool

POST/api/v1/mcp/servers/:id/tools

Add an integration action as a tool to the server.

Path Parameters

FieldTypeDescription
idstringServer ID

Request Body

FieldTypeRequiredDescription
integrationNamestringYesIntegration name
actionNamestringYesAction name
integrationAliasstringNoAlias for the integration (defaults to integrationName). Must match ^[a-z][a-z0-9_-]*$, max 64 chars
toolTypestringNoACTION or TRIGGER (default: ACTION)
connectionIdstring (uuid)NoConnection to use for this tool
displayNamestringNoCustom display name
descriptionstringNoCustom description
inputDefaultsobjectNoDefault input values
partialIdsstring[]NoPartial IDs to apply to this tool
sortOrdernumberNoSort position (default: 0)

Integration aliases allow the same integration to appear multiple times on a server under different names (e.g., slack_bot and slack_user), each with its own connection.

Response (201)

json
{
  "tool": {
    "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
    "mcpServerId": "abc123def456",
    "integrationName": "slack",
    "integrationAlias": "slack_bot",
    "actionName": "send_channel_message",
    "toolType": "ACTION",
    "connectionId": "c1d2e3f4-5678-90ab-cdef-1234567890ab",
    "sortOrder": 0
  }
}

Example

bash
curl -X POST https://api.weavz.io/api/v1/mcp/servers/abc123def456/tools \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "integrationName": "slack",
    "actionName": "send_channel_message",
    "integrationAlias": "slack_bot",
    "connectionId": "c1d2e3f4-5678-90ab-cdef-1234567890ab"
  }'

Errors

StatusCodeDescription
400VALIDATION_ERRORMissing required fields or invalid alias format
404NOT_FOUNDMCP server not found
409DUPLICATETool already exists on this server
409ALIAS_CONFLICTAlias is already mapped to a different integration

Update Tool

PATCH/api/v1/mcp/servers/:id/tools/:toolId

Update a tool's configuration.

Path Parameters

FieldTypeDescription
idstringServer ID
toolIdstring (uuid)Tool ID

Request Body

FieldTypeRequiredDescription
displayNamestringNoCustom display name
descriptionstringNoCustom description
inputDefaultsobjectNoDefault input values
connectionIdstring (uuid)NoConnection to use
sortOrdernumberNoSort position
integrationAliasstringNoUpdated alias

Response

json
{
  "tool": {
    "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
    "integrationAlias": "slack_bot",
    "displayName": "Send Bot Message",
    "sortOrder": 1
  }
}

Example

bash
curl -X PATCH https://api.weavz.io/api/v1/mcp/servers/abc123def456/tools/f1e2d3c4-b5a6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"displayName": "Send Bot Message", "sortOrder": 1}'

Errors

StatusCodeDescription
400VALIDATION_ERRORInvalid fields
404NOT_FOUNDServer or tool not found

Remove Tool

DELETE/api/v1/mcp/servers/:id/tools/:toolId

Remove a tool from the server.

Path Parameters

FieldTypeDescription
idstringServer ID
toolIdstring (uuid)Tool ID

Response

json
{
  "deleted": true,
  "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890"
}

Example

bash
curl -X DELETE https://api.weavz.io/api/v1/mcp/servers/abc123def456/tools/f1e2d3c4-b5a6-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDServer or tool not found

Execute Code

POST/api/v1/mcp/servers/:id/execute-code

Execute code against a CODE mode server. Used for testing code-mode integrations.

Path Parameters

FieldTypeDescription
idstringServer ID

Request Body

FieldTypeRequiredDescription
codestringYesJavaScript code to execute

Response

json
{
  "content": [
    {
      "type": "text",
      "text": "Execution result..."
    }
  ],
  "isError": false
}

Example

bash
curl -X POST https://api.weavz.io/api/v1/mcp/servers/abc123def456/execute-code \
  -H "Authorization: Bearer wvz_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"code": "const result = await weavz.slack.send_channel_message({ channel: \"C123\", text: \"Hello\" }); return result;"}'

Errors

StatusCodeDescription
400VALIDATION_ERRORMissing code
403QUOTA_EXCEEDEDSandbox quota exceeded
404NOT_FOUNDMCP server not found

Get TypeScript Declarations

GET/api/v1/mcp/servers/:id/declarations/:integrationOrAlias

Get TypeScript declarations for an integration on a CODE mode server. Returns type definitions for the weavz.* API surface.

Path Parameters

FieldTypeDescription
idstringServer ID
integrationOrAliasstringIntegration name or alias

Response

json
{
  "declarations": "declare namespace weavz {\n  namespace slack {\n    function send_channel_message(input: { channel: string; text: string }): Promise<any>;\n  }\n}"
}

Example

bash
curl https://api.weavz.io/api/v1/mcp/servers/abc123def456/declarations/slack \
  -H "Authorization: Bearer wvz_your_api_key"

Errors

StatusCodeDescription
404NOT_FOUNDServer or integration not found