diff --git a/.github/workflows/dev-build.yaml b/.github/workflows/dev-build.yaml index 671e52021b5..7173dd42942 100644 --- a/.github/workflows/dev-build.yaml +++ b/.github/workflows/dev-build.yaml @@ -6,7 +6,7 @@ concurrency: on: push: - branches: ['3157-feat-prompt-variables'] # put your current branch to create a build. Core team only. + branches: ['3000-mcp-compatibility'] # put your current branch to create a build. Core team only. paths-ignore: - '**.md' - 'cloud-deployments/*' @@ -43,6 +43,10 @@ jobs: fi id: dockerhub + # Uncomment this + add linux/arm64 to platforms if you want to build for arm64 as well + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 with: @@ -74,6 +78,7 @@ jobs: sbom: true provenance: mode=max platforms: linux/amd64 + # platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha diff --git a/docker/Dockerfile b/docker/Dockerfile index 1f7ed96dddf..221d2e400d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,10 +24,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ apt-get update && \ + # Install node and yarn apt-get install -yq --no-install-recommends nodejs && \ curl -LO https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb \ && dpkg -i yarn_1.22.19_all.deb \ && rm yarn_1.22.19_all.deb && \ + # Install uvx (pinned to 0.6.10) for MCP support + curl -LsSf https://astral.sh/uv/0.6.10/install.sh | sh && \ + mv /root/.local/bin/uv /usr/local/bin/uv && \ + mv /root/.local/bin/uvx /usr/local/bin/uvx && \ + echo "Installed uvx! $(uv --version)" && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -84,10 +90,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \ apt-get update && \ + # Install node and yarn apt-get install -yq --no-install-recommends nodejs && \ curl -LO https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb \ && dpkg -i yarn_1.22.19_all.deb \ && rm yarn_1.22.19_all.deb && \ + # Install uvx (pinned to 0.6.10) for MCP support + curl -LsSf https://astral.sh/uv/0.6.10/install.sh | sh && \ + mv /root/.local/bin/uv /usr/local/bin/uv && \ + mv /root/.local/bin/uvx /usr/local/bin/uvx && \ + echo "Installed uvx! $(uv --version)" && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* @@ -154,12 +166,6 @@ RUN chown -R anythingllm:anythingllm /app/server && \ chown -R anythingllm:anythingllm /app/collector USER anythingllm -# No longer needed? (deprecated) -# WORKDIR /app/server -# RUN npx prisma generate --schema=./prisma/schema.prisma && \ -# npx prisma migrate deploy --schema=./prisma/schema.prisma -# WORKDIR /app - # Setup the environment ENV NODE_ENV=production ENV ANYTHING_LLM_RUNTIME=docker diff --git a/frontend/src/media/agents/mcp-logo.svg b/frontend/src/media/agents/mcp-logo.svg new file mode 100644 index 00000000000..c47d4d933b7 --- /dev/null +++ b/frontend/src/media/agents/mcp-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/src/models/mcpServers.js b/frontend/src/models/mcpServers.js new file mode 100644 index 00000000000..40e660cc456 --- /dev/null +++ b/frontend/src/models/mcpServers.js @@ -0,0 +1,76 @@ +import { API_BASE } from "@/utils/constants"; +import { baseHeaders } from "@/utils/request"; + +const MCPServers = { + /** + * Forces a reload of the MCP Hypervisor and its servers + * @returns {Promise<{success: boolean, error: string | null, servers: Array<{name: string, running: boolean, tools: Array<{name: string, description: string, inputSchema: Object}>, error: string | null, process: {pid: number, cmd: string} | null}>}>} + */ + forceReload: async () => { + return await fetch(`${API_BASE}/mcp-servers/force-reload`, { + method: "GET", + headers: baseHeaders(), + }) + .then((res) => res.json()) + .catch((e) => ({ + servers: [], + success: false, + error: e.message, + })); + }, + + /** + * List all available MCP servers in the system + * @returns {Promise<{success: boolean, error: string | null, servers: Array<{name: string, running: boolean, tools: Array<{name: string, description: string, inputSchema: Object}>, error: string | null, process: {pid: number, cmd: string} | null}>}>} + */ + listServers: async () => { + return await fetch(`${API_BASE}/mcp-servers/list`, { + method: "GET", + headers: baseHeaders(), + }) + .then((res) => res.json()) + .catch((e) => ({ + success: false, + error: e.message, + servers: [], + })); + }, + + /** + * Toggle the MCP server (start or stop) + * @param {string} name - The name of the MCP server to toggle + * @returns {Promise<{success: boolean, error: string | null}>} + */ + toggleServer: async (name) => { + return await fetch(`${API_BASE}/mcp-servers/toggle`, { + method: "POST", + headers: baseHeaders(), + body: JSON.stringify({ name }), + }) + .then((res) => res.json()) + .catch((e) => ({ + success: false, + error: e.message, + })); + }, + + /** + * Delete the MCP server - will also remove it from the config file + * @param {string} name - The name of the MCP server to delete + * @returns {Promise<{success: boolean, error: string | null}>} + */ + deleteServer: async (name) => { + return await fetch(`${API_BASE}/mcp-servers/delete`, { + method: "POST", + headers: baseHeaders(), + body: JSON.stringify({ name }), + }) + .then((res) => res.json()) + .catch((e) => ({ + success: false, + error: e.message, + })); + }, +}; + +export default MCPServers; diff --git a/frontend/src/pages/Admin/Agents/AgentFlows/index.jsx b/frontend/src/pages/Admin/Agents/AgentFlows/index.jsx index 75b70efcc0c..4bb7d17e514 100644 --- a/frontend/src/pages/Admin/Agents/AgentFlows/index.jsx +++ b/frontend/src/pages/Admin/Agents/AgentFlows/index.jsx @@ -22,7 +22,7 @@ export default function AgentFlowsList({ } return ( -
+ {server.tools.length} {pluralize("tool", server.tools.length)}{" "} + available +
+ )} +Startup Command
++ Command: {config.command} +
++ Arguments:{" "} + {config.args ? config.args.join(" ") : "None"} +
++ This MCP server is not running - it may be stopped or experiencing an + error on startup. +
+{server.error}
+MCP Servers
+Loading MCP Servers from configuration file...
+ + Learn more about MCP Servers. + +No MCP servers found
+ + Learn more about MCP Servers. + +Agent Skills
@@ -229,11 +277,7 @@ export default function AdminAgents() {- Select an agent skill or flow + Select an Agent Skill, Agent Flow, or MCP Server
Select an agent skill or flow
++ Select an Agent Skill, Agent Flow, or MCP Server +