Learn how to use Model Context Protocol (MCP) actions in your SpinAI applications
npx spinai-mcp
helper function.
For example:
createActionsFromMcpConfig
function to convert them to regular SpinAI Actions.
Parameter | Type | Description |
---|---|---|
config | McpConfig | The MCP config file (mcp-config.ts). |
envMapping | Record<string, string | undefined> | Environment variable mappings to apply to all MCPs. Format: { "MCP_VAR_NAME": process.env.myVariable } . If this AND one in mcp-config.ts are passed in, it will prioritize this one. |
excludedActions | string[] | IDs of actions to exclude. |
includedActions | string[] | IDs of actions to include (if empty, all actions except excluded ones are included). |