# Model Context Protocol (MCP)
The Model Context Protocol (MCP) is an open standard that lets AI-powered code editors connect to external tools and data sources. Instead of copying documentation into prompts or switching between your editor and a browser, MCP gives your AI assistant direct access to APIs, schemas, and reference material in real time.

The Lithic MCP server brings this capability to the [Lithic Developer API](https://docs.lithic.com/). Once connected, your AI assistant can search Lithic documentation, inspect endpoint schemas, generate integration code, and execute live API requests, all from within your editor.

## Capabilities
Once connected, your AI coding assistant can:
- **Search Lithic documentation**: find guides, API references, and code examples by keyword
- **Explore API endpoints**: list all endpoints, inspect request/response schemas, and view code snippets in your language
- **Execute live API requests**: call the Lithic API directly from your editor (requires a [Lithic API key](https://docs.lithic.com/docs/authentication))
- **Generate integration code**: build Lithic integrations with real context from the API specification

## Prerequisites
- An AI code editor or chat app that supports MCP (see [supported clients](https://docs.lithic.com/reference/mcp#connect-your-editor-or-chat-app) below)
- A [Lithic API key (authentication guide)](https://docs.lithic.com/docs/authentication) (required for executing API requests; documentation search and exploration work without one)
- For sandbox testing, use a [Sandbox API key](https://docs.lithic.com/docs/sandbox) to safely simulate transactions

## Lithic MCP Server URL
Lithic hosts a remote MCP server at:
```
https://docs.lithic.com/mcp
```
This is a hosted server. No local installation, `npm install`, or Docker setup is required. Add the URL to your editor's MCP configuration and you're ready to go.

## Store Your API Key in a `.env` File
To execute live API requests through the MCP server, your AI assistant needs access to your [Lithic API key](https://docs.lithic.com/docs/authentication). The recommended approach is to store it in a `.env` file in your project root so your assistant can read it when making requests.

Create a `.env` file in your project directory:
```bash
# .env
LITHIC_API_KEY=your_sandbox_api_key_here
```
Replace `your_sandbox_api_key_here` with your actual key. You can find your Sandbox API key in the [Lithic Dashboard](https://app.lithic.com/).

> **Important:** Add `.env` to your `.gitignore` file to avoid committing your API key to version control.

```bash
# .gitignore
.env
```

Your AI assistant can then read the key from this file and include it as an `Authorization` header when using the `execute-request` tool.

## Connect Your Editor or Chat App
Select your editor or chat app and follow the setup instructions. Each section includes the exact configuration or steps you need.

### Cursor
Add to your project-level config (`.cursor/mcp.json`) or global config (`~/.cursor/mcp.json`):
```json
{
  "mcpServers": {
    "lithic": {
      "url": "https://docs.lithic.com/mcp"
    }
  }
}
```
You can also add it via **Cursor Settings > Features > MCP Servers > + Add new global MCP server**.

### Claude Code
Use the CLI to add the Lithic MCP server:
```bash
# Add to your current project
claude mcp add lithic --transport http https://docs.lithic.com/mcp

# Or add globally (available across all projects)
claude mcp add lithic --transport http --scope user https://docs.lithic.com/mcp
```
To share the configuration with your team, add a `.mcp.json` file to your project root instead:
```json
{
  "mcpServers": {
    "lithic": {
      "type": "http",
      "url": "https://docs.lithic.com/mcp"
    }
  }
}
```

### VS Code (GitHub Copilot)
Add a `.vscode/mcp.json` file to your project:
```json
{
  "servers": {
    "lithic": {
      "type": "http",
      "url": "https://docs.lithic.com/mcp"
    }
  }
}
```
> **Important:** VS Code uses `
