Skip to main content
Glama

How to Build an MCP Server in Python: Skills, Tasks and Elicitation

StudyOps MCP is a complete, tested MCP server built with the official MCP Python SDK (mcp 2.3). It manages a student's study notes and shows the three server features that became important in November 2026:

Feature

What this server does

Skills over MCP (SEP-2640)

Ships SKILL.md playbooks in skills/. They are served as skill:// resources with a SHA-256 manifest, plus skills/list and skills/get.

Tasks

start_study_report returns a task handle at once. The report is built in the background; poll it with tasks/get (or the get_task tool), stop it with tasks/cancel.

Elicitation

delete_note and clear_subject pause and show the user a confirmation form. Nothing is deleted unless the user types the exact title (or subject + count) and ticks "understood". Every outcome is written to an audit log.

Full step-by-step tutorial: https://getprojects.org/how-to-build-mcp-server-python/

Built for BTech, MCA and MTech students who want a modern, explainable final-year or mini project, and for anyone learning how to build an MCP server in Python.

Architecture of the StudyOps MCP server

Features

  • 12 tools: add_note, list_notes, search_notes, read_note, skills_catalog, delete_note, clear_subject, audit_log, start_study_report, get_task, cancel_task, list_tasks

  • Tool annotations (readOnlyHint, destructiveHint) so clients can tell safe tools from risky ones

  • Elicitation via the SDK's Resolve / Elicit resolvers, so the same code works on the 2025-11-25 protocol (server-to-client elicitation/create) and the 2026-07-28 protocol (InputRequiredResult round trips)

  • Two extensions advertised under capabilities.extensions: io.modelcontextprotocol/skills and io.modelcontextprotocol/tasks

  • Background task manager with progress, cancellation, TTL and pollInterval

  • JSON-file note store and JSONL audit log (no database needed)

  • stdio and Streamable HTTP transports

  • 52 pytest tests, including end-to-end runs over stdio and HTTP and on both protocol versions

  • GitHub Actions CI on Python 3.10, 3.12 and 3.13

Related MCP server: MCP Learning Console

Project structure

MCP-Server-Skills-Tasks-Elicitation-Python/
├── studyops_mcp/
│   ├── __main__.py      # CLI: python -m studyops_mcp [--transport streamable-http]
│   ├── server.py        # MCPServer, tools, elicitation forms
│   ├── skills.py        # Skills over MCP extension (skills/list, skills/get, skill:// resources)
│   ├── tasks.py         # Task manager + Tasks extension (tasks/get, tasks/cancel)
│   ├── report.py        # the long-running job: weekly study report
│   ├── store.py         # JSON note store
│   └── audit.py         # JSONL audit log
├── skills/
│   ├── safe-notes-cleanup/SKILL.md
│   ├── weekly-study-report/SKILL.md (+ references/report-format.md)
│   └── viva-prep/SKILL.md
├── examples/
│   ├── demo_client.py          # walks through every feature from a real MCP client
│   └── mcp-client-config.json  # sample config for Claude Desktop / Claude Code / IDEs
├── tests/                      # 52 pytest tests
└── .github/workflows/tests.yml

Setup

git clone https://github.com/GetProjectsIdea/MCP-Server-Skills-Tasks-Elicitation-Python.git
cd MCP-Server-Skills-Tasks-Elicitation-Python
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements-dev.txt

Requires Python 3.10+ and mcp>=2.3,<3.

Usage

# 1. See everything working (no AI client needed)
python examples/demo_client.py
python examples/demo_client.py --legacy   # same demo on the 2025-11-25 protocol

# 2. Run the tests
python -m pytest -q

# 3. Run the server for a real client
python -m studyops_mcp                                  # stdio (Claude Desktop, Claude Code, IDEs)
python -m studyops_mcp --transport streamable-http --port 8000   # http://127.0.0.1:8000/mcp

Notes are saved in ~/.studyops/notes.json (change with --data-dir or STUDYOPS_DATA). The audit log is ~/.studyops/audit.jsonl.

To add it to an MCP client, copy examples/mcp-client-config.json and set cwd to this folder. With Claude Code: claude mcp add studyops -- python -m studyops_mcp (run it from this folder).

Sample output

== 3. Tasks: start_study_report runs in the background ==
  returned at once: taskId=776a4d23b151 status=working
  tasks/get -> working   1/3  analysed Computer Networks (1/3)
  tasks/get -> working   2/3  analysed DBMS (2/3)
  tasks/get -> completed 3/3  done

== 4. Elicitation before destructive tools ==
  [form shown to user] Delete the note 'ACID properties' (DBMS, 9 words)? This cannot be undone. Type the title to confirm.
  [user] accept {"type_title": "ACID", "understood": true}
  delete_note -> {"deleted": false, "reason": "confirmation did not match: ..."}
  [user] accept {"type_title": "ACID properties", "understood": true}
  delete_note -> {"deleted": true, "title": "ACID properties"}

Elicitation confirmation forms before delete_note

Background task polled with tasks/get

52 pytest tests passing

Add your own skill

Create skills/<name>/SKILL.md:

---
name: my-skill
description: One sentence telling the model when to use this skill.
---

# Steps
1. ...

The folder name must match name (lowercase-hyphen-case). Restart the server; the skill appears in skills/list and as skill://my-skill/SKILL.md. Hidden files are never served.

Honest notes and limits

  • mcp 2.3.0 includes the Extension framework but not ready-made Skills or Tasks helpers, so skills.py and tasks.py implement them on the SDK's public Extension API. The task part is a small in-memory version for learning: it does not implement tasks/update, push notifications or the full SEP-2663 CreateTaskResult flow. Replace it with the SDK's own implementation when a release ships one.

  • Tasks live in one process's memory; they are lost when the server restarts.

  • Elicitation needs a client that supports form elicitation. If a client does not, the destructive tools fail with a "Client did not declare the form elicitation capability" error and delete nothing.

Safe use

This project is defensive by design: destructive actions need explicit human confirmation, read-only tools are marked as such, hidden files are never served as skills, and every delete attempt (accepted, declined, cancelled or mismatched) is audited. Do not give an MCP server more access than it needs.

License

MIT © 2026 Pardeep Patel, GetProjects.org

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers