Sponsored by Deepsite.site

🧠 Advanced MCP Server Setup with

Created By
sidhyaashu8 months ago
Advanced MCP Server Setup with uv, llama-index, ollama, and Cursor IDE
Content

🧠 Advanced MCP Server Setup with uv, llama-index, ollama, and Cursor IDE


✅ Prerequisites


🛠 Step 1: Project Setup

1.1 Create a New Project Directory

uv init mcp-server
cd mcp-server

1.2 Create and Activate Virtual Environment

uv venv
.venv\Scripts\activate  # On Windows
# OR
source .venv/bin/activate  # On Linux/Mac

🔐 Step 2: Environment Configuration

Create a .env file in the root of your project and add your API key:

LINKUP_API_KEY=your_api_key_here

📦 Step 3: Install Required Dependencies

Run these commands one by one inside your virtual environment:

# Core MCP CLI and HTTP utilities
uv add mcp[cli] httpx

# Linkup SDK for orchestrating agents
uv add linkup-sdk

# LlamaIndex integrations
uv add llama-index
uv add llama-index-embeddings-huggingface
uv add llama-index-llms-ollama

# Optional: for using notebooks
uv add ipykernel

🧪 Step 4: Confirm Installation

After installation, check your uv-managed pyproject.toml for something like this:

[tool.uv.dependencies]
mcp = { extras = ["cli"] }
httpx = "*"
linkup-sdk = "*"
llama-index = "*"
llama-index-embeddings-huggingface = "*"
llama-index-llms-ollama = "*"
ipykernel = "*"

⚙️ Step 5: Create a Minimal Server Entry Point

Create a server.py file inside the project root:

# server.py

from mcp.cli import app

if __name__ == "__main__":
    app()

You can later replace this with your own FastMCP or Agent orchestrator script.


🧠 Step 6: Run Ollama Locally

Make sure Ollama is installed and running:

ollama run llama3.2 Or any model you want

This starts the LLM backend at http://localhost:11434.


🖥️ Step 7: Configure MCP Server in Cursor IDE

7.1 Open Cursor Settings

  • Open Settings → Go to MCP section.
  • Click on "Add New Global MCP Server"

7.2 Fill Out the Configuration

Replace the paths with your actual machine paths. You can get the full path to uv by running:

where uv  # Windows

Now add this to your Cursor IDE settings:

{
  "mcpServers": {
    "weather": {
      "command": "C:\\Users\\SIDHYA\\AppData\\Roaming\\Python\\Python311\\Scripts\\uv.exe",  // Replace with your actual uv path
      "args": [
        "--directory",
        "C:\\Users\\SIDHYA\\Development\\Ai\\mcp-server",
        "run",
        "server.py"
      ]
    }
  }
}

🧪 Step 8: Test the Integration

  1. Open any .py file in Cursor.
  2. Use the MCP tools (usually accessible via ⌘K or Ctrl+K) to run the “weather” MCP server.
  3. You should see the server spin up using your server.py.

📘 Suggested Directory Structure

mcp-server/
├── .env
├── pyproject.toml
├── server.py
└── rag.py

🔁 Keep Things Updated

To update dependencies:

uv pip install --upgrade llama-index
uv pip install --upgrade linkup-sdk

✍️ Author

👋 Hey, I'm Asutosh Sidhya

🌐 Connect with Me

If you're building something around AI agents, local LLMs, or automated RAG pipelines—I'd love to connect or collaborate!

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
CursorThe AI Code Editor
Tavily Mcp