Skip to content

argotdev/tutor-mcp-ts

Repository files navigation

MCP Tutor Server

A Model Context Protocol (MCP) server that acts as an AI tutor based on your local educational materials including lecture notes, handouts, and textbooks.

Features

  • Document Access: Automatically indexes and reads educational materials (PDF, TXT, MD)
  • Concept Explanation: Get explanations of concepts based on your materials
  • Practice Quizzes: Generate quiz questions on specific topics
  • Topic Summaries: Create brief or detailed summaries of topics
  • Material Search: Search across all materials for specific keywords
  • Resource Listing: Browse all available educational documents

Installation

  1. Install dependencies:
npm install
  1. Build the server:
npm run build

Setup

1. Prepare Your Materials Directory

Create a directory for your educational materials and add your files:

mkdir materials

Add your files to this directory:

  • Lecture notes (.txt, .md)
  • Handouts (.pdf, .txt, .md)
  • Textbook chapters (.pdf)
  • Study guides (.md, .txt)

Example structure:

materials/
  ├── lectures/
  │   ├── week1-introduction.md
  │   └── week2-advanced-topics.pdf
  ├── textbooks/
  │   ├── chapter1.pdf
  │   └── chapter2.pdf
  └── handouts/
      └── study-guide.txt

2. Configure Claude Desktop

Add the server to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "tutor": {
      "command": "node",
      "args": ["/absolute/path/to/tutor/dist/index.js"],
      "env": {
        "TUTOR_MATERIALS_PATH": "/absolute/path/to/your/materials"
      }
    }
  }
}

Replace the paths with your actual paths.

3. Restart Claude Desktop

After updating the configuration, restart Claude Desktop for the changes to take effect.

Usage

Once configured, you can use the tutor tools in Claude Desktop:

Available Tools

  1. explain_concept

    • Explains concepts based on your materials
    • Example: "Use explain_concept to explain quantum entanglement"
  2. search_materials

    • Search for keywords across all materials
    • Example: "Use search_materials to find references to 'neural networks'"
  3. summarize_topic

    • Summarize a topic from your materials
    • Example: "Use summarize_topic to summarize machine learning basics"
  4. generate_quiz

    • Create practice questions on a topic
    • Example: "Use generate_quiz to create 5 questions on algorithms"
  5. list_topics

    • View all available educational documents
    • Example: "Use list_topics to see what materials are available"

Available Resources

The server also exposes all your documents as resources that Claude can read directly:

  • Each document appears as tutor:///path/to/document
  • Claude can read these to provide detailed answers

Environment Variables

  • TUTOR_MATERIALS_PATH: Path to your materials directory (default: ./materials)

Development

Watch mode for development:

npm run dev

Build for production:

npm run build

Supported File Formats

  • Text files: .txt, .md, .markdown
  • PDF files: .pdf (text extraction)

Tips

  1. Organize Your Materials: Use subdirectories to organize materials by course, topic, or week
  2. Clear Filenames: Use descriptive filenames that reflect the content
  3. Regular Updates: Add new materials as you receive them
  4. Text Format: For best results, use markdown or text files when possible (faster processing)

Troubleshooting

Materials Not Found

If the server reports no materials:

  1. Check that TUTOR_MATERIALS_PATH is set correctly
  2. Verify the directory exists
  3. Ensure files are in supported formats
  4. Check file permissions

PDF Reading Issues

If PDFs aren't being read correctly:

  1. Ensure PDFs contain text (not just images)
  2. For scanned documents, use OCR software first
  3. Check that pdf-parse is installed correctly

Server Not Starting

  1. Check the Claude Desktop logs
  2. Verify all dependencies are installed
  3. Ensure the path to index.js is correct
  4. Try running the server manually: node dist/index.js

Example Interaction

User: "I need help understanding the concepts from my lecture notes"

Claude: "I'll help you with that. Let me first see what materials are available." [Uses list_topics tool]

Claude: "I can see your lecture notes on quantum mechanics. What specific concept would you like me to explain?"

User: "Can you explain wave-particle duality?"

Claude: [Uses explain_concept tool with "wave-particle duality"] [Returns relevant excerpts from your materials and explanation]

User: "Can you quiz me on this topic?"

Claude: [Uses generate_quiz tool] [Creates practice questions based on your materials]

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published