Skip to content
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

Using MCP with an LLM API Instead of Claude’s Website #14

Open
EssadikElmangoug opened this issue Mar 12, 2025 · 11 comments
Open

Using MCP with an LLM API Instead of Claude’s Website #14

EssadikElmangoug opened this issue Mar 12, 2025 · 11 comments

Comments

@EssadikElmangoug
Copy link

Hello,

I found this awesome repo, and I really appreciate the work that has gone into it! I’d love to test it with one of my projects.

I have an idea to integrate MCP with an LLM API (such as Claude’s API) instead of using the official Claude website. Is this possible? If so, could you provide some guidance on how to set it up?

Looking forward to your insights. Thanks in advance!

@Steinium7
Copy link

Yeah, sounds good

Currently trying out open-source model integration, will come back here if I get something working

@liuluo129
Copy link

I have the same idea. I want to integrate such a feature into my project.

Users can describe the pet image they want, and the service will generate a 3D model.

Just thinking about this kind of experience makes me excited.

I'm looking forward to having a tutorial to guide on how to implement it.

@ahujasid
Copy link
Owner

Would be open to Pull Requests for this, I think it has a lot of potential

@winglight
Copy link

Great idea. I hope to get it to work with deepseek/ollama locally.

@caijimin
Copy link

Great, I also hope to use local deployed model.

@chrisrogers3d
Copy link

me too, want to use ollama and try deepseek, gemma, llama

@0x24a
Copy link

0x24a commented Mar 17, 2025

i am working on it, maybe i will submit a pr

@thearperson
Copy link

It's actually pretty easy to do with langchain. Tried gpt-4o, but the quality doesn't seem to be as good. Maybe someone can point what's wrong here?

from dotenv import load_dotenv
from langchain_azure_ai.chat_models import AzureAIChatCompletionsModel
from langchain_core.prompts import ChatPromptTemplate
from langchain_mcp_adapters.tools import load_mcp_tools
from langchain_openai import AzureChatOpenAI
from langgraph.prebuilt import create_react_agent
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
import asyncio

import os

load_dotenv()

AZURE_OPENAI_API_KEY = os.environ["AZURE_OPENAI_API_KEY"]
AZURE_OPENAI_ENDPOINT = os.environ["AZURE_OPENAI_ENDPOINT"]
AZURE_INFERENCE_CREDENTIAL = os.environ["AZURE_INFERENCE_CREDENTIAL"]
AZURE_INFERENCE_ENDPOINT = os.environ["AZURE_INFERENCE_ENDPOINT"]

model = AzureChatOpenAI(
    azure_deployment="gpt-4o",
    # azure_deployment="gpt-4o-mini",
    api_version="2024-12-01-preview",
)

server_params = StdioServerParameters(
    command="python",
    args=["/code/zeta/third_party/blender-mcp/src/blender_mcp/server.py"]
)

async def run_agent():
    input_messages = {
        "messages": [
            "Create a 3D scene of the solar system. Also make sure to add animations so that the planets orbit the sun."
        ]
    }
    async with stdio_client(server_params) as (read, write):
        async with ClientSession(read, write) as session:
            # Initialize the connection
            await session.initialize()

            # Get tools
            tools = await load_mcp_tools(session)

            # Create and run the agent
            agent = create_react_agent(model, tools)

            async for chunk in agent.astream(
                input_messages,
                config={"recursion_limit": 100}
            ):
                for value in chunk.values():
                    for message in value.get("messages", []):
                        message.pretty_print()


# Run the async function
if __name__ == "__main__":
    asyncio.run(run_agent())

@jjmilburn
Copy link

Works decently with a number of models through Windsurf Cascade.

@iewknewon
Copy link

tracking

Repository owner deleted a comment from richard-devbot Mar 25, 2025
@odragora
Copy link

odragora commented Mar 27, 2025

Google have released Gemini 2.5 Pro Experimental.

It is better than all other LLMs on the market, including Claude Sonnet, and it's also free.
Even if they change the free requests limits, it is still going to be much cheaper than Sonnet.

I really hope to see API integration and decoupling this from Claude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

13 participants