> ## Documentation Index
> Fetch the complete documentation index at: https://docs.valyu.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Local MCP

> Add powerful context retrieval capabilities to Claude using the Valyu MCP Server

<Note>
  Get **\$10 free credits** for the Valyu API when you sign up at
  [Valyu](https://platform.valyu.ai)!
</Note>

## Overview

The Valyu MCP Server is a Model Context Protocol (MCP) tool that enables AI models to retrieve high-quality context from Valyu's API. It provides comprehensive search capabilities across:

* Proprietary data sources
* Wikipedia
* arXiv
* PubMed
* Financial data
* Web search

## Prerequisites

Before you begin, ensure you have:

<Check>
  * Python 3.10 or higher - Claude Desktop (latest version) - [Valyu API
    Key](https://platform.valyu.ai)
</Check>

Verify your Python version:

```bash theme={null}
python --version
```

## Quick Start

### 1. Clone and Setup

First, clone the repository and set up your environment:

```bash theme={null}
git clone https://github.com/valyuAI/valyu-mcp.git
cd valyu-mcp
```

Create and activate a virtual environment:

<CodeGroup>
  `bash macOS/Linux python -m venv .venv source .venv/bin/activate ` `bash
      Windows python -m venv .venv .venv\Scripts\activate `
</CodeGroup>

Install dependencies:

```bash theme={null}
pip install -r requirements.txt
```

### 2. Configure Environment

Create a `.env` file with your API key:

```bash theme={null}
echo "VALYU_API_KEY=your-api-key-here" > .env
```

### 3. Set Up Claude Configuration

<Tabs>
  <Tab title="macOS">
    Open the config file: `bash code ~/Library/Application\
            Support/Claude/claude_desktop_config.json `
  </Tab>

  <Tab title="Windows">
    Open the config file: `powershell code
            %APPDATA%\Claude\claude_desktop_config.json `
  </Tab>
</Tabs>

Add the Valyu MCP server configuration:

```json theme={null}
{
  "mcpServers": {
    "valyu-mcp": {
      "command": "/ABSOLUTE/PATH/TO/.venv/bin/python",
      "args": ["-u", "/ABSOLUTE/PATH/TO/valyu-mcp.py"],
      "env": {
        "VALYU_API_KEY": "your-api-key-here"
      }
    }
  }
}
```

<Warning>
  Replace the paths with absolute paths to your Python virtual environment and
  the script location.
</Warning>

## Testing Your Setup

Once Claude Desktop restarts, you can confirm if your server is working properly:

1. **Look for the Tools Icon**

   A hammer icon (tools) should appear in the Claude Desktop interface when your MCP server is running successfully.

2. **Inspect Available Tools**

   Click the hammer icon to see the list of available tools. You should see `valyu-mcp` listed among the tools.

<Frame>
  <img src="https://mintcdn.com/valyu/ji-tdRNtRRe7QxMv/images/valyu-mcp-tools.png?fit=max&auto=format&n=ji-tdRNtRRe7QxMv&q=85&s=6964a2d08f0698d7b07bb78877c254fa" alt="Valyu MCP Tools Interface" width="1710" height="1202" data-path="images/valyu-mcp-tools.png" />
</Frame>

3. **Try Example Queries**

   Test the MCP server with queries that would benefit from Valyu's context retrieval. For example:

   > "What are the latest advancements in topological quantum computing"
   >
   > "Find recent research papers about agentic retrievel-augmented generation."
   >
   > "Explain the concept of volatility clustering in financial markets."

   Claude will indicate it's "Making a tool request: valyu-mcp" and then fetch context from the Valyu API.

<Frame>
  <img src="https://mintcdn.com/valyu/ji-tdRNtRRe7QxMv/images/valyu-mcp-response.png?fit=max&auto=format&n=ji-tdRNtRRe7QxMv&q=85&s=d4bdb7a1f8cbf0201a4e115690d3ee1f" alt="Example of Valyu MCP Response" width="3020" height="1540" data-path="images/valyu-mcp-response.png" />
</Frame>

### Monitoring Logs

For debugging or troubleshooting, you can view the server logs:

<Tabs>
  <Tab title="macOS">
    `bash tail -n 20 -F ~/Library/Logs/Claude/mcp*.log `
  </Tab>

  <Tab title="Windows">
    ```powershell Get-Content $env:APPDATA\Claude\Logs\mcp_valyu-mcp.log -Wait theme={null}
    ```
  </Tab>
</Tabs>

<Tip>
  You can also access logs through **Claude Desktop → Settings → Developer →
  Open Logs Folder**. Failed MCP servers will have dedicated log files with
  complete error traces.
</Tip>

## Troubleshooting

<Accordion title="Common Issues">
  ### ModuleNotFoundError

  Ensure your virtual environment is activated before running the script.

  ### Server Won't Start

  Double-check the paths in `claude_desktop_config.json` are absolute and correct.

  ### No Results from API

  Verify your API key is valid and has available credits.
</Accordion>

## Additional Resources

<CardGroup>
  <Card title="Valyu Platform" icon="shop" href="https://platform.valyu.ai">
    Get your API key and free credits
  </Card>

  <Card title="Documentation" icon="book" href="https://docs.valyu.ai">
    Explore the full Valyu API documentation
  </Card>

  <Card title="Blog" icon="newspaper" href="https://valyu.ai/blog">
    Read about our latest updates
  </Card>

  <Card title="GitHub" icon="github" href="https://github.com/valyuAI/valyu-mcp">
    View source code and contribute
  </Card>
</CardGroup>

## Contributing

We welcome contributions! Feel free to:

* Open issues for bug reports
* Submit feature requests
* Create pull requests

## License

This project is licensed under the MIT License.

***

<Note>
  Visit [valyu.ai](https://www.valyu.ai) to learn more about what
  we're building at Valyu.
</Note>
