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

# Installation

> Install and configure the Syncline MCP server

## Overview

The Syncline MCP server is available as an NPM package, making it easy to integrate with Claude Desktop, custom AI agents, or any MCP-compatible client.

## Quick Install

Install the Syncline MCP server via NPM:

```bash theme={null}
npm install -g @kekwanulabs/syncline-mcp-server
```

Or install locally in your project:

```bash theme={null}
npm install @kekwanulabs/syncline-mcp-server
```

## Requirements

<CardGroup cols={2}>
  <Card title="Node.js" icon="node-js">
    Node.js 18.0 or higher
  </Card>

  <Card title="Platform API Key" icon="key">
    Get your API key from the [developer dashboard](https://syncline.run/developer/login)
  </Card>
</CardGroup>

## Configuration

### Environment Variables

The MCP server requires your Syncline Platform API key:

```bash theme={null}
# Required
export SYNCLINE_API_KEY=sk_live_your_api_key_here
```

### Verify Installation

Test that the server is installed correctly:

```bash theme={null}
syncline-mcp-server --version
```

You should see the version number output:

```
1.0.1
```

## Integration Methods

### Option 1: Claude Desktop (Recommended)

Add Syncline to your Claude Desktop configuration:

```json theme={null}
{
  "mcpServers": {
    "syncline": {
      "command": "npx",
      "args": ["-y", "@kekwanulabs/syncline-mcp-server"],
      "env": {
        "SYNCLINE_API_KEY": "sk_live_your_api_key_here"
      }
    }
  }
}
```

<Note>
  See the [Claude Integration](/mcp/claude-integration) guide for complete setup instructions.
</Note>

### Option 2: Custom AI Agent (Python)

Use the Python MCP SDK to connect to the server:

```python theme={null}
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

server_params = StdioServerParameters(
    command="npx",
    args=["-y", "@kekwanulabs/syncline-mcp-server"],
    env={"SYNCLINE_API_KEY": "sk_live_your_api_key_here"}
)

async with stdio_client(server_params) as (read, write):
    async with ClientSession(read, write) as session:
        await session.initialize()
        tools = await session.list_tools()
        print(f"Available tools: {[tool.name for tool in tools]}")
```

<Note>
  See the [Python Client](/mcp/python-client) guide for more examples.
</Note>

### Option 3: Custom AI Agent (Node.js)

Use the Node.js MCP SDK:

```javascript theme={null}
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

const transport = new StdioClientTransport({
  command: "npx",
  args: ["-y", "@kekwanulabs/syncline-mcp-server"],
  env: {
    ...process.env,
    SYNCLINE_API_KEY: "sk_live_your_api_key_here"
  }
});

const client = new Client({
  name: "my-agent",
  version: "1.0.0"
}, {
  capabilities: {}
});

await client.connect(transport);
const { tools } = await client.listTools();
console.log("Available tools:", tools.map(t => t.name));
```

<Note>
  See the [Node.js Client](/mcp/nodejs-client) guide for more examples.
</Note>

## Available Tools

Once installed, the MCP server provides 4 tools:

<AccordionGroup>
  <Accordion title="find_mutual_availability" icon="calendar">
    Find time slots where all attendees are available.

    **Use case**: AI agent needs to find meeting times

    ```json theme={null}
    {
      "attendees": ["alice@example.com", "bob@example.com"],
      "duration_minutes": 30
    }
    ```
  </Accordion>

  <Accordion title="schedule_meeting" icon="plus">
    Create a calendar event with Google Meet link.

    **Use case**: AI agent books a meeting

    ```json theme={null}
    {
      "attendees": ["alice@example.com", "bob@example.com"],
      "start_time": "2025-01-22T14:00:00Z",
      "title": "Product Demo",
      "duration_minutes": 30
    }
    ```
  </Accordion>

  <Accordion title="check_availability" icon="clock">
    Check a single user's calendar for a specific time range.

    **Use case**: See if someone is free on a specific day

    ```json theme={null}
    {
      "email": "alice@example.com",
      "start_date": "2025-01-22",
      "end_date": "2025-01-22"
    }
    ```
  </Accordion>

  <Accordion title="update_preferences" icon="sliders">
    Update user scheduling preferences.

    **Use case**: User tells AI "I prefer morning meetings"

    ```json theme={null}
    {
      "email": "alice@example.com",
      "preferences": {
        "energy_pattern": "morning_person"
      }
    }
    ```
  </Accordion>
</AccordionGroup>

## Troubleshooting

### Command Not Found

If `syncline-mcp-server` command is not found after global install:

```bash theme={null}
# Verify npm global bin directory is in PATH
npm config get prefix

# Add to PATH if needed (add to ~/.bashrc or ~/.zshrc)
export PATH="$PATH:$(npm config get prefix)/bin"
```

### API Key Issues

If you get "Invalid API key" errors:

1. Verify your API key is correct
2. Check the key starts with `sk_live_` (not `sk_test_`)
3. Ensure the environment variable is set:

```bash theme={null}
echo $SYNCLINE_API_KEY
```

### Version Conflicts

If you have issues with multiple versions:

```bash theme={null}
# Uninstall all versions
npm uninstall -g @kekwanulabs/syncline-mcp-server

# Reinstall latest
npm install -g @kekwanulabs/syncline-mcp-server@latest
```

### Connection Issues

If the MCP server fails to connect:

1. Check Node.js version: `node --version` (must be 18+)
2. Verify network access to api.syncline.run
3. Check firewall settings

## Security Best Practices

<Warning>
  Never commit your API key to version control!
</Warning>

### Use Environment Variables

Store API keys in environment variables, not in code:

```bash theme={null}
# .env file (add to .gitignore!)
SYNCLINE_API_KEY=sk_live_your_api_key_here
```

Load environment variables in your app:

```javascript theme={null}
import dotenv from 'dotenv';
dotenv.config();

const apiKey = process.env.SYNCLINE_API_KEY;
```

### Rotate API Keys Regularly

Rotate your Platform API key every 90 days:

1. Generate new key in [developer dashboard](https://syncline.run/developer/login)
2. Update environment variable
3. Old key is immediately invalidated

See [Platform API Key Regeneration](/api-reference/platform-regenerate-key) for details.

## Upgrading

To upgrade to the latest version:

```bash theme={null}
# Global install
npm update -g @kekwanulabs/syncline-mcp-server

# Local install
npm update @kekwanulabs/syncline-mcp-server
```

Check the [changelog](https://github.com/KekwanuLabs/syncline/releases) for breaking changes.

## Uninstalling

To remove the MCP server:

```bash theme={null}
# Global install
npm uninstall -g @kekwanulabs/syncline-mcp-server

# Local install
npm uninstall @kekwanulabs/syncline-mcp-server
```

## Next Steps

<CardGroup cols={3}>
  <Card title="Claude Integration" icon="robot" href="/mcp/claude-integration">
    Add Syncline to Claude Desktop
  </Card>

  <Card title="Python Client" icon="python" href="/mcp/python-client">
    Build custom Python agents
  </Card>

  <Card title="Node.js Client" icon="node-js" href="/mcp/nodejs-client">
    Build custom Node.js agents
  </Card>
</CardGroup>
