# MCP-Saptiva
An MCP (Model Context Protocol) server for interacting with Saptiva AI's LLMs and tools.
## Features
- **Chat Completions**: Access Saptiva's various LLM models
- **Reasoning**: Chain-of-thought reasoning with Saptiva Cortex
- **OCR**: Extract text from images using Saptiva OCR
- **Embeddings**: Generate semantic embeddings for text
- **Help System**: Built-in documentation and examples
## Available Tools
| Tool | Description |
|------|-------------|
| `saptiva_chat` | Send chat completion requests to Saptiva AI models |
| `saptiva_reason` | Complex reasoning with chain-of-thought (Cortex model) |
| `saptiva_ocr` | Extract text from images using vision model |
| `saptiva_embed` | Generate semantic embeddings for text |
| `saptiva_batch_embed` | Batch embedding generation for multiple texts |
| `saptiva_list_models` | List all available models with pricing |
| `saptiva_help` | Built-in documentation and examples |
## Help Topics
Use `saptiva_help` with these topics:
| Topic | Description |
|-------|-------------|
| `quick_start` | Getting started with Saptiva API |
| `chat_example` | Complete chat request/response example |
| `reasoning_example` | Using Cortex for reasoning |
| `ocr_example` | Extracting text from images |
| `embedding_example` | Generating embeddings |
| `all_tools` | List of all available tools |
| `curl_examples` | cURL commands for terminal |
| `agents_sdk` | Saptiva Agents SDK documentation |
## Available Prompts
| Prompt | Description |
|--------|-------------|
| `code_review` | Review code for bugs and improvements |
| `explain_concept` | Explain technical concepts at different levels |
| `write_documentation` | Generate documentation for code |
| `debug_help` | Help debug errors and issues |
| `mexican_legal` | Mexican legal/regulatory questions (uses KAL model) |
## Available Models
| Model | Best For | Tools Support | Pricing (per M tokens) |
|-------|----------|---------------|------------------------|
| Saptiva Turbo | Fast responses, high concurrency | Yes | $0.20 / $0.60 |
| Saptiva Cortex | Reasoning tasks with chain-of-thought | Yes | $0.30 / $0.80 |
| Saptiva Ops | Complex cases, RAG, web search | No | $0.20 / $0.60 |
| Saptiva Legacy | Compatibility with legacy tools | Yes | $0.20 / $0.60 |
| Saptiva OCR | Document text extraction, vision | No | $0.15 / $0.50 |
| Saptiva Embed | Semantic vectorization | N/A | $0.01 / - |
| Saptiva KAL | Mexico-specific context | Yes | $0.20 / $0.60 |
## Installation
```bash
npm install
npm run build
```
## Configuration
1. Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
2. Add your Saptiva API key to `.env`:
```
SAPTIVA_API_KEY=your_api_key_here
```
3. Get your API key from [Saptiva Lab](https://lab.saptiva.com/)
## Usage with Claude Desktop
Add to your Claude Desktop MCP configuration:
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"saptiva": {
"command": "node",
"args": ["/path/to/MCP-Saptiva/dist/index.js"],
"env": {
"SAPTIVA_API_KEY": "your_api_key_here"
}
}
}
}
```
## Quick Examples
### Chat
```json
{
"model": "Saptiva Turbo",
"messages": [
{"role": "user", "content": "¿Qué es Python?"}
]
}
```
### Reasoning
```json
{
"question": "Si tengo 5 manzanas y como 2, ¿cuántas quedan?",
"max_tokens": 500
}
```
### OCR
```json
{
"image_url": "https://example.com/document.png",
"prompt": "Extrae todo el texto de esta imagen"
}
```
### Embeddings
```json
{
"text": "Texto para convertir a vector"
}
```
## Resources
The server exposes two resources:
- `saptiva://models` - List of all models with capabilities
- `saptiva://pricing` - Pricing information for all models
## Development
```bash
# Install dependencies
npm install
# Build
npm run build
# Run tests
node test-comprehensive.mjs
```
## Related Projects
- **[Saptiva Agents SDK](https://saptiva.gitbook.io/saptiva-agents)** - Python framework for building AI agents
- **[PyPi Package](https://pypi.org/project/saptiva-agents/)** - `pip install saptiva-agents`
## Links
- [Saptiva API Documentation](https://saptiva.gitbook.io/saptiva-docs)
- [Saptiva Agents Documentation](https://saptiva.gitbook.io/saptiva-agents)
- [Saptiva Lab (Get API Key)](https://lab.saptiva.com/)
- [MCP Protocol](https://modelcontextprotocol.io/)
## License
MIT