Skip to content

ModelContextProtocol (MCP) Full Compatibility #3547

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/dev-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*'
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
18 changes: 12 additions & 6 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand Down Expand Up @@ -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/*

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions frontend/src/media/agents/mcp-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions frontend/src/models/mcpServers.js
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion frontend/src/pages/Admin/Agents/AgentFlows/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function AgentFlowsList({
}

return (
<div className="bg-theme-bg-secondary text-white rounded-xl min-w-[360px] w-fit">
<div className="bg-theme-bg-secondary text-white rounded-xl w-full md:min-w-[360px]">
{flows.map((flow, index) => (
<div
key={flow.uuid}
Expand Down
5 changes: 1 addition & 4 deletions frontend/src/pages/Admin/Agents/Imported/SkillList/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { CaretRight } from "@phosphor-icons/react";
import { isMobile } from "react-device-detect";
import { sentenceCase } from "text-case";

export default function ImportedSkillList({
Expand Down Expand Up @@ -27,9 +26,7 @@ export default function ImportedSkillList({

return (
<div
className={`bg-theme-bg-secondary text-white rounded-xl ${
isMobile ? "w-full" : "min-w-[360px] w-fit"
}`}
className={`bg-theme-bg-secondary text-white rounded-xl w-full md:min-w-[360px]`}
>
{skills.map((config, index) => (
<div
Expand Down
Loading