Akyn AI logo

Akyn AI

Community
IlyesTal

Turn any data source into an MCP server in 5 minutes. Build AI-agents-ready knowledge bases.

PublisherIlyesTal
Repositoryakyn-sdk
LanguageTypeScript
Forks
5
Stars
22
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Akyn AI exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    22 stars and 5 forks from the linked repository.

akyn-ai

Turn any data source into an MCP server in 5 minutes.

Build knowledge bases that AI assistants like Claude and Cursor can query directly. No infrastructure needed.

npm version License: MIT


What is this?

This SDK lets you create MCP (Model Context Protocol) servers from any data source. Your docs, PDFs, websites, or any text can become a queryable knowledge base that AI assistants can access directly.

Use cases:

  • 📚 Make your documentation searchable by Cursor/Claude
  • 🔍 Build RAG (Retrieval-Augmented Generation) pipelines
  • 🤖 Create custom AI assistants with domain knowledge
  • 📖 Index research papers, guides, or any text content

Quick Start

Install

bash
npm install akyn-ai

Basic Usage

typescript
import { KnowledgeBase } from 'akyn-ai'

// Create a knowledge base
const kb = new KnowledgeBase({
  name: 'my-docs',
  description: 'My project documentation',
})

// Add your content
await kb.addDirectory('./docs')           // Add all docs from a folder
await kb.addFile('./README.md')           // Add a specific file
await kb.addURL('https://docs.example.com') // Scrape a URL
await kb.addText('Important info here')   // Add raw text

// Serve as MCP server
kb.serveStdio()  // For Cursor/Claude Desktop

Connect to Cursor

Add to your .cursor/mcp.json:

json
{
  "mcpServers": {
    "my-docs": {
      "command": "npx",
      "args": ["ts-node", "./my-kb.ts"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Connect to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{
  "mcpServers": {
    "my-docs": {
      "command": "npx",
      "args": ["ts-node", "/path/to/my-kb.ts"],
      "env": {
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Features

📁 Multi-Source Ingestion

typescript
// Files (PDF, DOCX, TXT, Markdown)
await kb.addFile('./guide.pdf')
await kb.addFile('./manual.docx')

// Directories (recursive)
await kb.addDirectory('./docs', {
  recursive: true,
  extensions: ['.md', '.txt', '.pdf'],
})

// URLs
await kb.addURL('https://docs.example.com')
await kb.addURLs([
  'https://example.com/page1',
  'https://example.com/page2',
])

// Raw text
await kb.addText('Custom content here', 'My Notes')

🔍 Smart Chunking

Text is automatically split into optimal chunks for embedding:

typescript
const kb = new KnowledgeBase({
  name: 'my-kb',
  chunking: {
    maxSize: 1000,    // Max characters per chunk
    overlap: 200,     // Overlap between chunks for context
  },
})

🧠 Flexible Embeddings

Uses OpenAI by default, but you can bring your own:

typescript
import { KnowledgeBase, type EmbeddingsProvider } from 'akyn-ai'

// Use OpenAI (default)
const kb = new KnowledgeBase({ name: 'my-kb' })

// Or customize OpenAI settings
import { OpenAIEmbeddings } from 'akyn-ai'

const kb = new KnowledgeBase({
  name: 'my-kb',
  embeddings: new OpenAIEmbeddings({
    model: 'text-embedding-3-large',  // Better quality
    apiKey: 'sk-...',
  }),
})

// Or bring your own provider
class MyEmbeddings implements EmbeddingsProvider {
  readonly dimensions = 384
  
  async embed(text: string) {
    // Your embedding logic here
    return { embedding: [...], tokenCount: 100 }
  }
  
  async embedBatch(texts: string[]) {
    return Promise.all(texts.map(t => this.embed(t)))
  }
}

const kb = new KnowledgeBase({
  name: 'my-kb',
  embeddings: new MyEmbeddings(),
})

💾 Vector Stores

In-Memory (Default)

Perfect for development and small datasets:

typescript
import { InMemoryVectorStore } from 'akyn-ai'

const kb = new KnowledgeBase({
  name: 'my-kb',
  vectorStore: new InMemoryVectorStore({
    persistPath: './kb-data.json',  // Optional: save to disk
  }),
})

Qdrant

For production workloads, use Qdrant - a high-performance vector database:

typescript
import { KnowledgeBase, QdrantVectorStore } from 'akyn-ai'

const kb = new KnowledgeBase({
  name: 'my-kb',
  vectorStore: new QdrantVectorStore(),  // That's it!
})

Local Setup (Docker)

bash
# Start Qdrant with one command
docker run -p 6333:6333 qdrant/qdrant

# With persistent storage
docker run -p 6333:6333 -v ./qdrant_data:/qdrant/storage qdrant/qdrant

Qdrant Cloud

For managed hosting, use Qdrant Cloud:

typescript
const kb = new KnowledgeBase({
  name: 'my-kb',
  vectorStore: new QdrantVectorStore({
    url: 'https://your-cluster.cloud.qdrant.io',
    apiKey: process.env.QDRANT_API_KEY,
    collection: 'my-docs',  // Optional: defaults to 'akyn_documents'
  }),
})
OptionTypeDefaultDescription
urlstringhttp://localhost:6333Qdrant server URL
apiKeystring-API key (required for Qdrant Cloud)
collectionstringakyn_documentsCollection name
dimensionsnumberauto-detectedVector dimensions

Custom Vector Store

Implement the VectorStore interface for other databases (Pinecone, Weaviate, etc.):

typescript
import type { VectorStore } from 'akyn-ai'

class MyVectorStore implements VectorStore {
  async add(document) { /* ... */ }
  async addBatch(documents) { /* ... */ }
  async search(embedding, options) { /* ... */ }
  async delete(id) { /* ... */ }
  async clear() { /* ... */ }
  async count() { /* ... */ }
}

🌐 Multiple Transport Options

typescript
// Stdio (for Cursor/Claude Desktop)
kb.serveStdio()

// HTTP (for web clients)
await kb.serveHttp({ port: 3000 })

CLI Usage

You can also use the CLI without writing code:

bash
# Index a directory
npx akyn-ai --dir ./docs --name "My Docs"

# Use a config file
npx akyn-ai --config ./kb-config.json

# Run as HTTP server
npx akyn-ai --dir ./docs --http 3000

Config File Format

json
{
  "name": "My Knowledge Base",
  "description": "Project documentation",
  "sources": [
    { "type": "directory", "path": "./docs" },
    { "type": "file", "path": "./README.md" },
    { "type": "url", "url": "https://docs.example.com" }
  ]
}

API Reference

KnowledgeBase

Main class for creating and managing knowledge bases.

typescript
const kb = new KnowledgeBase({
  name: string,           // Required: Name of the knowledge base
  description?: string,   // Optional: Description
  version?: string,       // Optional: Version (default: '1.0.0')
  embeddings?: EmbeddingsProvider,  // Optional: Custom embeddings
  vectorStore?: VectorStore,        // Optional: Custom vector store
  chunking?: ChunkOptions,          // Optional: Chunking settings
  retrieval?: RetrievalOptions,     // Optional: Retrieval settings
})

Retrieval Options

Control how many results are returned and their minimum quality. These options are configured in your code (not exposed to AI agents), giving you full control over retrieval behavior.

typescript
const kb = new KnowledgeBase({
  name: 'my-kb',
  retrieval: {
    topK: 10,         // Return up to 10 chunks per query
    threshold: 0.5,   // Only return chunks with similarity score >= 0.5
  },
})
OptionTypeDefaultDescription
topKnumber5Maximum number of chunks to retrieve per query
thresholdnumber0Minimum similarity score (0-1). Set to 0 to return all results, or higher (e.g. 0.5, 0.7) to filter out less relevant chunks

Methods

MethodDescription
addText(text, name?)Add raw text content
addFile(path, name?)Add a file (PDF, DOCX, TXT, MD)
addDirectory(path, options?)Add all files from a directory
addURL(url, name?)Add content from a URL
addURLs(urls)Add multiple URLs
query(question, options?)Query the knowledge base
listSources()List all indexed sources
serveStdio(options?)Start stdio MCP server
serveHttp(options?)Start HTTP MCP server

HTTP Server Options

typescript
await kb.serveHttp({
  port: 3000,           // Port to listen on (default: 3000)
  host: '0.0.0.0',      // Host to bind to (default: '0.0.0.0')
  cors: true,           // Enable CORS (default: true)
  corsOrigin: '*',      // CORS origin (default: '*')
  debug: false,         // Enable debug logging (default: false)
})

Utilities

The SDK also exports utilities you can use independently:

typescript
import {
  // Text processing
  normalizeText,
  chunkText,
  extractTextFromHTML,
  stripMarkdown,
  
  // File loading
  loadFile,
  loadDirectory,
  loadURL,
  
  // Embeddings
  OpenAIEmbeddings,
  cosineSimilarity,
  
  // Vector stores
  InMemoryVectorStore,
  QdrantVectorStore,
} from 'akyn-ai'

MCP Tools

When connected via MCP, your knowledge base exposes these tools:

query

Search the knowledge base with a natural language question.

json
{
  "name": "query",
  "arguments": {
    "question": "How do I authenticate?"
  }
}
ParameterTypeDescription
questionstringThe question to search for

Note: The number of results and similarity threshold are configured via the retrieval option when creating the KnowledgeBase. See Retrieval Options.

list_sources

List all indexed sources in the knowledge base.

json
{
  "name": "list_sources",
  "arguments": {}
}

Examples

See the examples directory for more:


Requirements

  • Node.js 18+
  • OpenAI API key (or custom embeddings provider)

Want Managed Hosting?

Building something bigger? Check out Akyn for:

  • ☁️ Hosted knowledge bases
  • 👥 Team collaboration
  • 📊 Usage analytics
  • 💰 Monetization (charge for queries)
  • 🔐 API key management

Contributing

Contributions welcome! Please read our contributing guidelines first.


License

MIT © Akyn AI

Use Akyn AI MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Akyn AI is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Akyn AI as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Akyn AI MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "akyn-sdk": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Akyn AI MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Akyn AI MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Akyn AI to help me with this task?
Akyn AI
Sure. I read it.
Here is what I found using Akyn AI.

Frequently asked questions

What is the Akyn AI MCP server used for?

Akyn AI is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Akyn AI MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Akyn AI with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Akyn AI MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Akyn AI connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Akyn AI MCP to TypingMind?

Akyn AI runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Akyn AI MCP provide in TypingMind?

Akyn AI exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Akyn AI MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Akyn AI requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇