Skip to main content
Glama
Hussainzz

MCP Support Agent

by Hussainzz

MCP Support Agent

This repo started as a small Express ticket API. I used it to learn how an existing API can be exposed through MCP, then added an Ollama-based agent and document search with local embeddings and LanceDB.

The code covers two use cases:

  • ticket tools backed by a REST API

  • support-document search backed by a local vector database

How it works

User question
    ↓
Ollama model
    ↓ requests a tool
TypeScript MCP client
    ↓ stdio
MCP server
    ├── ticket tools → Express REST API
    └── document search → EmbeddingGemma → LanceDB

The model sees the available tools through MCP listTools(). When it requests a tool, the TypeScript client calls the MCP server and sends the result back to the model.

Related MCP server: OTRS MCP Server

MCP tools

Tool

Description

get_tickets

Get all tickets from the REST API

get_ticket

Get one ticket by ID

create_ticket

Create a ticket after user approval

search_documents

Search support articles by meaning and optional category

Support articles are split into sentences and embedded with embeddinggemma:300m-qat-q4_0. The indexing script stores the chunks and their vectors in LanceDB.

At query time, only the question is embedded. LanceDB applies the tenant and category filters, performs a cosine-distance search, and returns up to two matches within the configured distance threshold.

Indexing and querying use the same embedding model. If the model or source articles change, rebuild the index.

Setup

Requirements:

  • Node.js 20 or newer

  • Ollama running locally

Install the project and download the local models:

npm install
ollama pull embeddinggemma:300m-qat-q4_0
ollama pull qwen3:1.7b

Build the vector database:

npm run index:documents

LanceDB writes its files to data/, which is ignored by Git.

Run the local agent

npm run agent:local

The included prompt asks for printer help. The agent calls search_documents and prints the sources collected from the MCP result below the model's answer.

Run the ticket API

npm run dev

Available routes:

GET  /tickets
GET  /tickets/:id
POST /tickets

Tickets are kept in memory, so created tickets are cleared when the server restarts.

Run the cloud agent

The cloud example needs an Ollama API key. Copy .env.example to .env and set the key, then run the API and agent in separate terminals:

npm run start
npm run agent:cloud

The example prompt creates a ticket and fetches another one. Write tools require confirmation before they run.

Retrieval checks

npm run evaluate:retrieval

The current test set contains three queries with expected articles and one query that should return no result:

Evaluation accuracy: 4/4 (100%)

This is only a check against the small set of articles in this repo, not a general embedding benchmark.

Tenant filtering

Documents for two sample companies are stored in the same LanceDB table. The MCP server uses a fixed company-a tenant to stand in for an authenticated session.

The tool schema does not accept tenantId. A client can send that extra field, but it cannot override the tenant used by the server. A real application would take this value from a verified session or token instead of a constant.

Commands

Command

Description

npm run typecheck

Check TypeScript

npm run build

Compile the project

npm run index:documents

Rebuild the LanceDB table

npm run evaluate:retrieval

Run retrieval checks

npm run test:mcp

List MCP tools and call document search directly

npm run agent:local

Run the local Ollama example

npm run agent:cloud

Run the Ollama Cloud example

npm run documents:upsert

Insert or replace the sample Wi-Fi article

npm run documents:delete

Delete the sample Wi-Fi article

Project layout

src/        API, MCP server, agents, and document search
scripts/    Indexing, document updates, and retrieval checks
examples/   Small examples built while learning each piece
F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Hussainzz/api-mcp-rag'

If you have feedback or need assistance with the MCP directory API, please join our Discord server