Learn to integrate local and MCP-hosted tools into your agents effectively. This blog post details creating a simple LangGraph agent utilizing both a PyPI-hosted MCP server and locally defined tools in Python. The example agent connects to a Neo4j graph database, showcasing the flexibility to apply these concepts across various agents and MCP servers.
Follow the provided instructions to deploy the agent locally, utilizing either uv
or pip
for package installation, while requiring an OpenAI API key for the LLM. The agent architecture includes essential components like the LLM, prompts, and tools. For this demo, the Neo4j Cypher MCP server offers tools to assist the agent in generating queries related to movie recommendations.
By the end of this tutorial, you’ll have a modifiable agent template that can be adapted for different databases or queries, making it versatile for various applications. Explore the documentation for deeper insights into MCP tools.