Skip to main content
Glama
artem-amplemarket

Amplemarket Knowledge Base MCP Server

README.md
# MCP Amplemarket Knowledge Base Server

A Model Context Protocol (MCP) server that provides seamless access to the Amplemarket Knowledge Base via Pylon's API. Designed specifically for Claude Desktop and other MCP-compatible clients.

## Features

- **šŸ” Smart Search**: Search through Amplemarket articles by title and content
- **šŸ“„ Article Access**: Retrieve full article content by ID or slug  
- **šŸ“š Complete Catalog**: Get all available Amplemarket articles at once
- **🌐 Resource Support**: Access articles via URI scheme
- **⚔ Fast Caching**: Built-in 60-second cache to reduce API calls
- **šŸ”’ Secure**: Environment-based API token configuration
- **šŸŽÆ Focused**: Hardcoded for Amplemarket knowledge base - no configuration needed

## Setup

1. **Install dependencies**:
   ```bash
   npm install
   ```

2. **Configure your API key**:
   ```bash
   cp .env.example .env
   ```
   
   Then edit the `.env` file and add your Pylon API token:
   ```bash
   PYLON_API_TOKEN=your_actual_api_token_here
   ```
   
   > **Important**: Replace `your_actual_api_token_here` with your real Pylon API token. You can get this token from your Pylon dashboard.

3. **Build the project**:
   ```bash
   npm run build
   ```

4. **Test the server**:
   ```bash
   npm start
   ```

## Configuration

### Environment Variables

- `PYLON_API_TOKEN`: Your Pylon API token (required)

### Claude Desktop Integration

Add to your Claude Desktop `mcp.json` configuration:

```json
{
  "mcpServers": {
    "pylon-kb": {
      "command": "node",
      "args": ["./dist/src/index.js"],
      "cwd": "/path/to/mcp-pylon-kb",
      "env": { 
        "PYLON_API_TOKEN": "your_actual_api_token_here"
      }
    }
  }
}
```

> **Note**: Replace `/path/to/mcp-pylon-kb` with the actual path to this project directory, and `your_actual_api_token_here` with your real Pylon API token.

## Tools

### `kb.search`
Search for articles in the knowledge base.

**Parameters:**
- `query` (string, required): Search query
- `limit` (number, optional): Maximum results (1-100, default: 10)
- `collectionId` (string, optional): Limit search to specific collection

### `kb.getArticle`
Get a specific article by ID or slug.

**Parameters:**
- `id` (string, optional): Article ID
- `slug` (string, optional): Article slug

*Note: Either `id` or `slug` must be provided.*

### `kb.getCollection`
Get collection metadata and articles.

**Parameters:**
- `id` (string, required): Collection ID

## Resources

The server supports the `pylon-article://` URI scheme:

- `pylon-article://<article-id>` - Get article by ID
- `pylon-article://<article-slug>` - Get article by slug
- `pylon-article://help` - Get resource usage help

## API Client

The Pylon API client (`src/pylon.ts`) handles:

- Authentication with Bearer token
- HTTP requests via undici
- HTML to text conversion
- In-memory caching with TTL
- Error handling

## Development

```bash
# Install dependencies
npm install

# Build
npm run build

# Development mode (build + run)
npm run dev

# Run tests
npm test
```

## Project Structure

```
mcp-pylon-kb/
ā”œā”€ā”€ package.json
ā”œā”€ā”€ tsconfig.json
ā”œā”€ā”€ .env.example
ā”œā”€ā”€ README.md
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ index.ts          # MCP server entry point
│   ā”œā”€ā”€ pylon.ts          # Pylon API client
│   ā”œā”€ā”€ schema.ts         # Zod validation schemas
│   └── tools/            # MCP tool implementations
│       ā”œā”€ā”€ kbSearch.ts
│       ā”œā”€ā”€ kbGetArticle.ts
│       └── kbGetCollection.ts
└── tests/
    ā”œā”€ā”€ htmlToText.test.ts
    └── searchAdapter.test.ts
```

## Security

- API tokens are never logged or exposed in responses
- All sensitive data is read from environment variables
- Input validation with Zod schemas
- Error messages don't leak sensitive information

## License

MIT

TDQS

B3.1/5.0

Scored across 3 tools

Disambiguation3/5

The first two tools have clear distinct purposes (get all articles vs. get a specific article), but the third tool 'kb_get_collection' introduces ambiguity. Its description mentions 'Pylon knowledge base' while the server name and other tools reference 'Amplemarket knowledge base', creating confusion about whether this is part of the same system or a different one. The overlapping 'get' functionality across all three tools could cause misselection.

Naming Consistency2/5

The naming is inconsistent with mixed conventions. The first two tools follow a 'amplemarket_verb_noun' pattern, while the third uses 'kb_verb_noun' with a different prefix. Additionally, 'get_all_articles' uses 'all' while 'get_collection' uses 'collection' for what might be similar concepts. The inconsistent prefixes and terminology create a lack of predictable pattern.

Tool Count3/5

With only 3 tools, this feels thin for a knowledge base server that presumably needs more operations like search, create, update, or delete. However, the tools do cover basic retrieval functionality. The count is borderline - adequate for minimal retrieval but insufficient for comprehensive knowledge base management.

Completeness2/5

The tool surface is severely incomplete for a knowledge base server. There are only retrieval operations (get all articles, get specific article, get collection) with no ability to search, create, update, or delete content. The third tool's description mentioning 'Pylon knowledge base' creates additional confusion about domain boundaries. This represents significant gaps that will cause agent failures when trying to perform basic knowledge base management tasks.