Skip to content

Commit 40430df

Browse files
committed
fix(mcp): missing isDeployed in contract breaking settings, parameter overrides lack of clarity
1 parent 9a2e06e commit 40430df

20 files changed

Lines changed: 17100 additions & 178 deletions

File tree

apps/docs/content/docs/en/workflows/deployment/mcp.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Once your workflow is deployed, you can expose it as an MCP tool:
8282
/>
8383
</div>
8484

85-
3. Configure the tool name and description
86-
4. Add descriptions for each parameter (helps AI understand inputs)
85+
3. Configure the tool name and description (the description defaults to the workflow's description)
86+
4. Review the parameter descriptions (prefilled from your Start block inputs) and override any per tool
8787
5. Select which MCP servers to add it to
8888
6. Click **Save Tool**
8989

@@ -97,10 +97,14 @@ The workflow must be deployed before it can be added as an MCP tool.
9797
Use lowercase letters, numbers, and underscores. The name should be descriptive and follow MCP naming conventions (e.g., `search_documents`, `send_email`).
9898

9999
### Description
100-
Write a clear description of what the tool does. This helps AI assistants understand when to use the tool.
100+
Write a clear description of what the tool does. This helps AI assistants understand when to use the tool. If you leave it blank, the tool falls back to the workflow's description.
101101

102102
### Parameters
103-
Your workflow's input format fields become tool parameters. Add descriptions to each parameter to help AI assistants provide correct values.
103+
Your workflow's input format fields become tool parameters. Each parameter's description defaults to the description set on that input in the Start block; edit it here to override it for this tool (the Start block stays the default source). Descriptions help AI assistants provide correct values.
104+
105+
<Callout type="info">
106+
Parameter descriptions live on your Start block inputs. A deployed tool picks up Start block changes the next time you redeploy the workflow; use a per-tool override only when a tool needs a different description than the default.
107+
</Callout>
104108

105109
## Connecting MCP Clients
106110

@@ -220,7 +224,7 @@ Workflows execute using the same deployment version as API calls, ensuring consi
220224
{ question: "How do I authenticate MCP client connections?", answer: "Include your API key in the X-API-Key header when connecting via mcp-remote or other HTTP-based MCP transports. The server validates authentication using hybrid auth that supports both session-based and API key-based access." },
221225
{ question: "Can I add the same workflow to multiple MCP servers?", answer: "Yes. When configuring a workflow as an MCP tool, you can select multiple MCP servers to add it to. Each server exposes its own URL, so you can organize tools into different servers for different use cases or clients." },
222226
{ question: "What naming conventions should I follow for tool names?", answer: "Use lowercase letters, numbers, and underscores only. The name should be descriptive and follow MCP naming conventions, such as search_documents or send_email. This helps AI assistants understand and correctly invoke your tools." },
223-
{ question: "How are workflow inputs mapped to MCP tool parameters?", answer: "Your workflow's input format fields automatically become MCP tool parameters. You can add descriptions to each parameter in the MCP configuration to help AI assistants understand what values to provide." },
227+
{ question: "How are workflow inputs mapped to MCP tool parameters?", answer: "Your workflow's input format fields automatically become MCP tool parameters. Each parameter's description defaults to the description set on that input in the Start block, and you can override it per tool in the MCP configuration to help AI assistants understand what values to provide." },
224228
]} />
225229

226230

apps/sim/app/api/mcp/serve/[serverId]/route.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import {
5353
MCP_TOOL_BRIDGE_ACTOR_HEADER,
5454
MCP_TOOL_BRIDGE_HEADER,
5555
} from '@/lib/mcp/constants'
56+
import { getMeaningfulWorkflowDescription } from '@/lib/mcp/workflow-tool-schema'
5657
import { getUserEntityPermissions } from '@/lib/workspaces/permissions/utils'
5758

5859
const logger = createLogger('WorkflowMcpServeAPI')
@@ -601,8 +602,11 @@ async function handleToolsList(
601602
toolName: workflowMcpTool.toolName,
602603
toolDescription: workflowMcpTool.toolDescription,
603604
parameterSchema: workflowMcpTool.parameterSchema,
605+
workflowName: workflow.name,
606+
workflowDescription: workflow.description,
604607
})
605608
.from(workflowMcpTool)
609+
.innerJoin(workflow, eq(workflowMcpTool.workflowId, workflow.id))
606610
.where(
607611
and(
608612
eq(workflowMcpTool.serverId, serverId),
@@ -629,7 +633,10 @@ async function handleToolsList(
629633
)
630634
return {
631635
name: tool.toolName,
632-
description: tool.toolDescription || `Execute workflow: ${tool.toolName}`,
636+
description:
637+
tool.toolDescription?.trim() ||
638+
getMeaningfulWorkflowDescription(tool.workflowDescription, tool.workflowName) ||
639+
`Execute workflow: ${tool.toolName}`,
633640
inputSchema: {
634641
type: 'object' as const,
635642
properties: schema?.properties || {},

apps/sim/app/api/mcp/workflow-servers/[id]/tools/[toolId]/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export const PATCH = withRouteHandler(
114114
actorEmail: userEmail,
115115
toolName: body.toolName,
116116
toolDescription: body.toolDescription,
117+
parameterDescriptionOverrides: body.parameterDescriptionOverrides,
117118
parameterSchema: body.parameterSchema,
118119
})
119120
if (!result.success || !result.tool) {

apps/sim/app/api/mcp/workflow-servers/[id]/tools/route.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const GET = withRouteHandler(
6464
toolName: workflowMcpTool.toolName,
6565
toolDescription: workflowMcpTool.toolDescription,
6666
parameterSchema: workflowMcpTool.parameterSchema,
67+
parameterDescriptionOverrides: workflowMcpTool.parameterDescriptionOverrides,
6768
createdAt: workflowMcpTool.createdAt,
6869
updatedAt: workflowMcpTool.updatedAt,
6970
workflowName: workflow.name,
@@ -122,6 +123,7 @@ export const POST = withRouteHandler(
122123
workflowId: body.workflowId,
123124
toolName: body.toolName,
124125
toolDescription: body.toolDescription,
126+
parameterDescriptionOverrides: body.parameterDescriptionOverrides,
125127
parameterSchema: body.parameterSchema,
126128
})
127129
if (!result.success || !result.tool) {

apps/sim/app/workspace/[workspaceId]/settings/components/workflow-mcp-servers/workflow-mcp-servers.tsx

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
44
import { createLogger } from '@sim/logger'
55
import { getErrorMessage } from '@sim/utils/errors'
66
import { Check, Clipboard, Plus, Server } from 'lucide-react'
7-
import { useParams } from 'next/navigation'
7+
import { useParams, useSearchParams } from 'next/navigation'
88
import {
99
Badge,
1010
Button,
@@ -186,7 +186,7 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
186186
workspaceId,
187187
serverId,
188188
toolId: toolToView.id,
189-
toolDescription: editingDescription.trim() || undefined,
189+
toolDescription: editingDescription.trim(),
190190
parameterSchema: updatedSchema,
191191
})
192192
setToolToView(null)
@@ -395,15 +395,22 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
395395
<Tooltip.Root>
396396
<Tooltip.Trigger asChild>
397397
<div className='inline-flex'>
398-
<Chip disabled>Add Workflows</Chip>
398+
<Chip leftIcon={Plus} variant='primary' disabled>
399+
Add Workflows
400+
</Chip>
399401
</div>
400402
</Tooltip.Trigger>
401403
<Tooltip.Content>
402404
All deployed workflows have been added to this server.
403405
</Tooltip.Content>
404406
</Tooltip.Root>
405407
) : (
406-
<Chip onClick={() => setShowAddWorkflow(true)} disabled={!canAddWorkflow}>
408+
<Chip
409+
leftIcon={Plus}
410+
variant='primary'
411+
onClick={() => setShowAddWorkflow(true)}
412+
disabled={!canAddWorkflow}
413+
>
407414
Add Workflows
408415
</Chip>
409416
)}
@@ -430,34 +437,9 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
430437
<div className='min-h-[300px] pt-4'>
431438
{activeServerTab === 'workflows' && (
432439
<div className='flex flex-col gap-4.5'>
433-
<div className='flex items-center justify-between'>
434-
<span className='font-medium text-[var(--text-primary)] text-sm'>
435-
Workflows
436-
</span>
437-
{showAddDisabledTooltip ? (
438-
<Tooltip.Root>
439-
<Tooltip.Trigger asChild>
440-
<div className='inline-flex'>
441-
<Chip leftIcon={Plus} variant='primary' disabled>
442-
Add Workflow
443-
</Chip>
444-
</div>
445-
</Tooltip.Trigger>
446-
<Tooltip.Content>
447-
All deployed workflows have been added to this server.
448-
</Tooltip.Content>
449-
</Tooltip.Root>
450-
) : (
451-
<Chip
452-
leftIcon={Plus}
453-
variant='primary'
454-
onClick={() => setShowAddWorkflow(true)}
455-
disabled={!canAddWorkflow}
456-
>
457-
Add Workflow
458-
</Chip>
459-
)}
460-
</div>
440+
<span className='font-medium text-[var(--text-primary)] text-sm'>
441+
Workflows
442+
</span>
461443

462444
{tools.length === 0 ? (
463445
<p className='text-[var(--text-muted)] text-sm'>
@@ -915,6 +897,7 @@ function ServerDetailView({ workspaceId, serverId, onBack }: ServerDetailViewPro
915897
export function WorkflowMcpServers() {
916898
const params = useParams()
917899
const workspaceId = params.workspaceId as string
900+
const searchParams = useSearchParams()
918901

919902
const { data: servers = [], isLoading, error } = useWorkflowMcpServers(workspaceId)
920903
const { data: deployedWorkflows = [], isLoading: isLoadingWorkflows } =
@@ -923,7 +906,9 @@ export function WorkflowMcpServers() {
923906

924907
const [searchTerm, setSearchTerm] = useState('')
925908
const [showAddModal, setShowAddModal] = useState(false)
926-
const [selectedServerId, setSelectedServerId] = useState<string | null>(null)
909+
const [selectedServerId, setSelectedServerId] = useState<string | null>(() =>
910+
searchParams.get('mcpServerId')
911+
)
927912
const [serverToDelete, setServerToDelete] = useState<WorkflowMcpServer | null>(null)
928913
const [deletingServers, setDeletingServers] = useState<Set<string>>(() => new Set())
929914

0 commit comments

Comments
 (0)