Skip to main content
Glama
kalpesh122

agentic-mcp-server

by kalpesh122

agentic-mcp-server

A production-grade Model Context Protocol server template in TypeScript, with the agentic-kit built in: one AGENTS.md every AI coding agent reads, skills that encode how to add tools, resources, and prompts, hooks that block destructive commands and force just check to pass before an agent can say "done", and a multi-model (Claude + Codex + Gemini) code-review council in CI.

It ships a small but complete example, a markdown knowledge base, exposed three ways: tools (kb.search, kb.get, kb.add, sys.time), resources (kb://index, kb://doc/{slug} with listing and completion), and prompts (summarise-doc, answer-with-sources). It runs over stdio for local hosts (Claude Code, Claude Desktop, Cursor) and over Streamable HTTP (stateless, bearer-token protected) for shared deployments. Tool handlers are SDK-free definitions; only src/server.ts and the transports touch @modelcontextprotocol/sdk, so upgrading to the v2 SDK line is a two-file change. Tests drive the server in-process through the official client, over real HTTP, and with the MCP Inspector CLI.

60-second quickstart

git clone https://github.com/kalpesh122/agentic-mcp-server my-mcp && cd my-mcp
just setup && just build
just test-inspector                # tools/list + a tools/call through the Inspector CLI

Register it in Claude Code (project scope) with the included .mcp.json, or:

claude mcp add --scope project kb -- node dist/index.js

Requirements: Node 24 (.node-version), just. Docker only for the image.

Related MCP server: bare-mcp

Commands

Command

What it does

just setup

Install dependencies (pnpm 12 via corepack)

just dev / just dev-http

Run over stdio / Streamable HTTP with watch

just test [pattern]

Vitest (in-process client, HTTP transport, store, env)

just test-inspector

Build and drive dist/index.js with the Inspector CLI

just inspect

Open the Inspector UI against the built server

just lint / just fmt

Biome check / fix

just typecheck

tsc --noEmit

just build

Compile to dist/

just check

Quality gate: lint + typecheck + test + build

just docker-build / just docker-up

Image and compose (HTTP mode on 3333)

just council

Local multi-model code review of your branch

Capabilities

Tools

Tool

Description

Annotations

kb.search

Full-text search over the knowledge base; nested filter object (tag, sort); returns hits + structuredContent

read-only, idempotent

kb.get

Full markdown of one document by slug

read-only, idempotent

kb.add

Create a document; refused unless MCP_ALLOW_WRITES=true

write, non-destructive

sys.time

Current time, optional IANA zone

read-only

Resources

URI

Content

kb://index

JSON list of {slug, title, tags}

kb://doc/{slug}

One document as text/markdown; template lists all docs and completes slugs

Prompts

Prompt

Arguments

Purpose

summarise-doc

slug

Five-bullet summary of one document

answer-with-sources

question

Answer using only the knowledge base, citing slugs

Register the server

Claude Code (.mcp.json, committed in this repo):

{ "mcpServers": { "kb": { "type": "stdio", "command": "node", "args": ["dist/index.js"] } } }

HTTP mode: { "type": "http", "url": "http://localhost:3333/mcp", "headers": { "Authorization": "Bearer ${MCP_AUTH_TOKEN}" } } or claude mcp add --transport http --scope project kb http://localhost:3333/mcp --header "Authorization: Bearer $MCP_AUTH_TOKEN".

Cursor (.cursor/mcp.json): same mcpServers shape as above.

Claude Desktop (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json): same mcpServers shape; use an absolute path to dist/index.js and fully quit the app after editing.

Configuration

See .env.example. MCP_TRANSPORT (stdio | http), MCP_HTTP_PORT/MCP_HTTP_HOST, MCP_AUTH_TOKEN (required, 16+ chars, in HTTP mode), KB_DIR (markdown directory), MCP_ALLOW_WRITES, LOG_LEVEL. The --transport CLI flag overrides the env.

Folder map

src/index.ts             CLI entry (--transport), env, knowledge base, start
src/env.ts  src/log.ts   zod env · pino to stderr
src/server.ts            createServer(deps): registers tools, resources, prompts (only SDK touchpoint besides transports)
src/tools/               types.ts (defineTool, text, failure) + one file per tool + index.ts
src/resources/           kb://index, kb://doc/{slug}
src/prompts/             summarise-doc, answer-with-sources
src/kb/store.ts          KnowledgeBase (load, search, get, add)
src/transports/          stdio.ts · http.ts (express: /health, bearer-protected stateless /mcp)
test/                    helpers (in-memory client), server.test.ts, http.test.ts
data/*.md                knowledge base documents (frontmatter title/tags)
.claude/ .agents/ AGENTS.md   the agentic kit

How AI agents work in this repo

  • AGENTS.md (≤150 lines) is the map: commands, layout, hard rules, definition of done. CLAUDE.md imports it; Gemini, Copilot, and Cursor point at it.

  • Skills in .claude/skills/ (mirrored in .agents/skills/): add-tool, add-resource, add-prompt, plus the kit's brainstorm-spec, tdd, debug, code-review, council-review, verify-before-done, adr, git-hygiene.

  • Hooks in .claude/settings.json: block rm -rf, force pushes, reading .env; protect lockfiles; format every edited file with Biome; run just check when the agent tries to stop and block if it fails.

  • CI: ci.yml runs just check and the Inspector smoke, then builds the image; ai-council-review.yml has three models review every PR and post one consolidated comment.

  • specs/001-knowledge-base/ shows the spec → plan → tasks flow; docs/adr/ records why the stack looks like this.

Swap-outs

  • Domain: replace src/kb/ and the tools in src/tools/ with your own; keep defineTool and the tests' shape.

  • Auth: replace bearerAuth in src/transports/http.ts with OAuth 2.1 resource-server checks; keep /health public.

  • SDK v2 (@modelcontextprotocol/server 2.x, spec 2026-07-28): change the imports in src/server.ts and src/transports/*; tool definitions do not change.

  • Hosting: the image runs HTTP on 3333 behind any TLS-terminating proxy.

License

MIT © Kalpesh Mali

Available Tools

4 tools
kb.addAdd a documentA

Create a new markdown document in the knowledge base. Fails if writes are disabled on this server or the slug already exists. Ask the user before calling this.

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyYesMarkdown body
slugYeskebab-case identifier, e.g. "release-checklist"
tagsNo
titleYes

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the write nature (matching readOnlyHint=false) and adds specific failure modes, going beyond the annotations to explain behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, using two sentences that cover purpose and key constraints without unnecessary details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple create operation, the description covers necessary context: what it does, when it fails, and the need for user confirmation. No output schema is required for this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 'body' and 'slug' descriptions, but 'title' and 'tags' lack descriptions. The description text adds no parameter-specific information, so it does not compensate for the missing schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create a new markdown document') and the resource ('knowledge base'), distinguishing it from sibling tools like kb.search and kb.get.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states failure conditions (writes disabled, slug already exists) and instructs the user to ask before calling, providing clear guidance on when to use the tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kb.getRead a documentA
Read-onlyIdempotent

Return the full markdown body of one knowledge-base document by slug (as returned by kb.search).

ParametersJSON Schema
NameRequiredDescriptionDefault
slugYesDocument slug, e.g. "getting-started"

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint and idempotentHint as true, covering side-effect safety. The description adds the return format ('full markdown body') and that it returns a single document, but these are minor additions beyond the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, focused sentence with no superfluous words. It is well-structured, front-loading the core action and then the parameter detail, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with one parameter and no output schema, the description provides all necessary context: what it returns (full markdown body), how to identify the document (by slug), and where the slug comes from (kb.search). No critical information is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides a clear description for the slug parameter (including an example). The tool description reinforces this and adds the important context that the slug comes from kb.search, which helps the agent understand how to populate the parameter correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('Return'), the resource ('knowledge-base document'), and the means ('by slug'). It also references kb.search for obtaining the slug, making the purpose unambiguous and distinct from the sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly guides usage by stating the slug is 'as returned by kb.search', which tells the agent to use kb.search first. However, it does not explicitly contrast with kb.add or state when not to use this tool, so it falls short of fully explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

kb.searchSearch the knowledge baseA
Read-onlyIdempotent

Full-text search over the markdown knowledge base. Returns the best-matching documents with a slug (use it with kb.get), title, score and a short snippet. Use this first when you need information you do not already have.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of hits
queryYesSearch terms; matches title, tags and body
filterNoOptional filters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint, so the description does not need to repeat those. It adds no extra behavioral details beyond what the annotations provide, but it also does not contradict them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and well-structured: one sentence states the core purpose and another covers the output and usage workflow. No unnecessary words or redundant details are present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Since there is no output schema, the description usefully specifies the return fields: slug, title, score, and snippet. It also explains the relationship with kb.get. It does not mention error cases or empty results, but for a search tool this is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema covers all parameters with descriptions: query, limit, and filter with nested tag and sort. The tool description adds no additional parameter-level detail beyond the schema, so it remains at the baseline for full schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'search' and clearly identifies the resource as the markdown knowledge base. It states the tool returns best-matching documents, and the phrase 'Use this first when you need information you do not already have' clearly differentiates it from other retrieval tools like kb.get.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says to use this tool first when needing information, and it mentions using the returned slug with kb.get, which provides workflow context. It does not explicitly enumerate when not to use it or compare with kb.add or sys.time, but the guidance is clear enough.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sys.timeCurrent timeA
Read-only

Return the current date and time in ISO 8601, optionally for an IANA time zone.

ParametersJSON Schema
NameRequiredDescriptionDefault
timeZoneNoIANA zone such as "Asia/Kolkata"; defaults to UTC

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the output format (ISO 8601) and the optional timezone behavior, which goes beyond the readOnlyHint annotation. While the read-only nature is already declared, the description adds useful behavioral details about the response, such as format and timezone handling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that conveys all essential information without unnecessary wording. It is well-structured and directly states the tool's purpose and optional parameter.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool that returns the current time, the description, combined with the schema, covers all necessary context: what the tool does, the output format, and the parameter's meaning and default. No additional information is needed for a user to invoke it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema already provides a clear description for the timeZone parameter, including an example and default behavior. The tool description adds no new information about the parameter beyond what is already in the schema, so it does not enhance the parameter semantics beyond the baseline.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: returning the current date and time in ISO 8601 format, with an optional timezone parameter. It is specific about the resource (current time) and the action (return), leaving no ambiguity about what the tool does.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly distinguishes this tool from the sibling knowledge-base tools (kb.search, kb.get, kb.add) by focusing on time retrieval. However, it does not explicitly state when to prefer this over alternatives, though the distinct purpose makes the use case obvious. A minor lack of explicit guidance prevents a perfect score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedkb.add
    • First observedkb.get
    • First observedkb.search
    • First observedsys.time

TDQS

A4.2/5.0
Disambiguation5/5

Each tool targets a distinct operation: search returns matches, get retrieves a full document by slug, add creates a new document, and sys.time provides system time. There is no overlap in purpose or return type.

Naming Consistency5/5

The knowledge base tools follow a consistent kb.<verb> pattern (search, get, add), and the system tool uses sys.time. Prefix-based namespaces make the convention predictable and easy to reason about.

Tool Count4/5

Four tools is a compact but reasonable set for a focused knowledge base server with a system utility. It is not overly thin, though a couple more operations could strengthen the scope.

Completeness3/5

The surface covers search, retrieval, and creation of knowledge base documents, but lacks update, delete, and list-all operations. This leaves notable CRUD gaps that agents cannot work around directly.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A minimal, general-purpose implementation of the Model Context Protocol (MCP) for Node.js and Bare runtime, enabling creation of AI-interactive servers with tools, resources, and multiple transport options.
    11
    2
    MIT
  • F
    license
    Not graded
    quality
    A
    maintenance
    A minimal Model Context Protocol server exposing arithmetic, time, and note-taking tools over streamable HTTP, with in-memory state and Docker support.
    -

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/kalpesh122/agentic-mcp-server'

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