MCP Server Learning

MCP Server Learning

Enables educational and learning tasks including flashcard generation with Anki integration, Zotero library management, Obsidian vault interaction, and mathematical expression verification with LaTeX support.

Category
访问服务器

README

MCP Server Learning

A Model Context Protocol (MCP) server designed to help with learning and educational tasks. Includes flashcard generation, Zotero integration, Obsidian connectivity, and mathematical verification tools.

Features

Flashcard Server

The flashcard server provides tools for creating, managing, and exporting flashcards in various formats:

  • Multiple Card Types: Support for front-back cards, cloze deletion cards, and diagram cards
  • LaTeX Support: Generate LaTeX-formatted flashcards with mathematical notation support
  • Anki Integration: Direct upload to Anki using AnkiConnect addon
  • HTML Preview: Generate beautiful HTML previews of your flashcards
  • Diagram Support: Handle ASCII art, TikZ diagrams, and flowcharts

Mathematical Verification Server

A comprehensive server for verifying mathematical expressions and proofs:

  • LaTeX Input: Native support for LaTeX mathematical notation
  • Multi-Step Proof Verification: Verify complete proofs step-by-step
  • Calculus Support: Derivatives, integrals, limits, and series
  • Linear Algebra: Matrix operations and vector spaces
  • Expression Simplification: Automatically simplify complex expressions with step-by-step explanations
  • Identity Checking: Verify mathematical identities (Pythagorean, trigonometric, etc.)

Installation

This project uses uv for dependency management.

# Clone the repository
git clone <repository-url>
cd mcp-server-learning

# Install dependencies
uv sync

# Install in development mode
uv pip install -e .

Usage

Running the Servers

FastMCP entrypoints are provided for each server:

# Flashcards / Anki
uv run fastmcp-flashcard-server

# Zotero
export ZOTERO_API_KEY=... \
       ZOTERO_LIBRARY_ID=... \
       ZOTERO_LIBRARY_TYPE=user   # or group
uv run fastmcp-zotero-server

# Obsidian
export OBSIDIAN_VAULT_PATH="/path/to/your/Obsidian/Vault"
uv run fastmcp-obsidian-server

# Mathematical Verification
uv run fastmcp-math-server

Available Tools

create_flashcards

Convert text content into LaTeX flashcards.

Parameters:

  • content (required): Text content to convert
  • card_type: "front-back" or "cloze" (default: "front-back")
  • title: Title for the deck (default: "Flashcards")
  • full_document: Whether to return complete LaTeX document (default: true)

Example input formats:

Q: What is the capital of France?
A: Paris

---

What is 2 + 2?
4

For cloze cards:

The capital of {{France}} is {{Paris}}.

create_single_card

Create a single flashcard.

Parameters:

  • For front-back cards: front, back
  • For cloze cards: cloze_text
  • card_type: "front-back" or "cloze"

create_diagram_card

Create a flashcard with a diagram.

Parameters:

  • diagram: The diagram content
  • explanation: Explanation of the diagram
  • diagram_type: "ascii", "tikz", or "flowchart"

upload_to_anki

Upload flashcards directly to Anki.

Parameters:

  • content: Content to convert and upload
  • card_type: Type of cards to create
  • deck_name: Anki deck name (default: "MCP Generated Cards")
  • tags: Array of tags to add
  • anki_api_key: Optional API key for AnkiConnect

check_anki_connection

Check connection to Anki and list available decks/models.

preview_cards

Generate HTML preview of flashcards.

Parameters:

  • content: Content to preview
  • card_type: Type of cards
  • title: Preview title
  • tags: Tags to display

Zotero Integration Tools

connect_zotero

Connect to your Zotero library using Web API or local database.

Parameters:

  • api_key: Zotero Web API key (optional for local access)
  • user_id: Your Zotero user ID for personal library
  • group_id: Zotero group ID for group library
  • local_profile_path: Path to local Zotero profile (optional)
  • prefer_local: Whether to prefer local database over Web API

search_zotero

Search items in your connected Zotero library.

Parameters:

  • query: Search terms
  • limit: Maximum number of results (default: 20)

get_zotero_collections

List all collections in your Zotero library.

create_flashcards_from_zotero

Generate flashcards from Zotero items or collections.

Parameters:

  • item_keys: Specific Zotero item keys to use
  • collection_id: Collection ID to generate cards from
  • card_types: Types of cards to create (citation, summary, definition)
  • citation_style: Citation format (apa)

Zotero MCP Server

A FastMCP server for interacting with Zotero libraries using the pyzotero package.

Available Tools

search_zotero_items

Search for items in your Zotero library.

Parameters:

  • query (required): Search terms
  • limit: Maximum results (default: 50)
  • item_type: Filter by type (e.g., 'book', 'journalArticle')

get_zotero_item

Get detailed information about a specific item.

Parameters:

  • item_key (required): The Zotero item key

get_item_notes

Get all notes associated with an item.

Parameters:

  • item_key (required): The Zotero item key

list_zotero_collections

List all collections in the library.

get_collection_items

Get items from a specific collection.

Parameters:

  • collection_key (required): The collection key
  • limit: Maximum results (default: 50)

create_zotero_item

Create a new item in the library.

Parameters:

  • item_type (required): Type of item ('book', 'journalArticle', etc.)
  • title (required): Item title
  • creators: Array of creator objects
  • date: Publication date
  • url: Item URL
  • abstract: Abstract/summary
  • tags: Array of tag strings
  • extra_fields: Additional type-specific fields

create_item_note

Add a note to an existing item.

Parameters:

  • parent_item_key (required): Key of the parent item
  • note_content (required): HTML-formatted note content

add_item_to_collection

Add an item to a collection.

Parameters:

  • item_key (required): The item key
  • collection_key (required): The collection key

get_item_templates

Get templates for creating different item types.

Obsidian MCP Server

A FastMCP server for interacting with Obsidian vaults and markdown notes.

Available Tools

get_vault_stats

Get comprehensive statistics about your Obsidian vault.

list_vault_notes

List all notes in the vault with optional pagination.

Parameters:

  • limit: Maximum number of notes to return
  • offset: Number of notes to skip (for pagination)
  • refresh_cache: Whether to refresh the note cache

search_obsidian_notes

Search for notes by content, title, or tags.

Parameters:

  • query (required): Search terms
  • search_in: Fields to search in (content, title, tags)
  • limit: Maximum number of results

get_obsidian_note

Get detailed information about a specific note.

Parameters:

  • note_name (required): Name of the note (without .md extension)

get_notes_by_tag

Get all notes that have a specific tag.

Parameters:

  • tag (required): Tag to search for

get_note_backlinks

Find all notes that link to a specific note.

Parameters:

  • note_name (required): Name of the note to find backlinks for

get_orphaned_notes

Find notes that have no incoming or outgoing links.

get_note_links

Get all wikilinks from a specific note.

Parameters:

  • note_name (required): Name of the note to get links from

extract_note_headers

Extract structured headers from a note.

Parameters:

  • note_name (required): Name of the note to extract headers from

extract_note_blocks

Extract content blocks (paragraphs, lists, quotes, code) from a note.

Parameters:

  • note_name (required): Name of the note to extract blocks from
  • block_types: Types of blocks to extract (paragraph, list, quote, code, header)

get_notes_for_flashcards

Extract content from notes that is suitable for flashcard generation.

Parameters:

  • note_names: Names of specific notes to process
  • tag_filter: Only process notes with this tag
  • content_types: Types of content to extract (headers, definitions, lists, quotes)

Obsidian Integration Tools

connect_obsidian

Connect to an Obsidian vault.

Parameters:

  • vault_path: Path to your Obsidian vault directory

search_obsidian

Search notes in your connected Obsidian vault.

Parameters:

  • query: Search terms
  • search_in: Fields to search (content, title, tags)
  • limit: Maximum number of results (default: 20)

get_obsidian_vault_stats

Get statistics about your Obsidian vault (note count, tags, etc.).

create_flashcards_from_obsidian

Generate flashcards from Obsidian notes.

Parameters:

  • note_names: Specific note names to process
  • tag_filter: Only process notes with this tag
  • content_types: Types of content to extract (headers, definitions, lists, quotes)
  • card_type: Type of flashcards to generate (front-back, cloze)

Mathematical Verification MCP Server

A FastMCP server for verifying mathematical expressions and multi-step proofs using SymPy. Focused on calculus, analysis, and linear algebra with LaTeX input support.

Available Tools

verify_step

Verify a single mathematical step with proper justification.

Parameters:

  • expression (required): Mathematical expression in LaTeX format (e.g., \frac{d}{dx}(x^2))
  • expected_result (required): Expected result in LaTeX format (e.g., 2x)
  • assumptions: Optional list of assumptions (e.g., ["x is real"])
  • operation: Type of operation - "equality", "derivative", "integral", or "limit"

Examples:

verify_step("x^2 + 2x + 1", "(x+1)^2", operation="equality")
verify_step("x^2", "2x", operation="derivative")

verify_proof

Verify a multi-step mathematical proof.

Parameters:

  • steps (required): List of proof steps. Each step should contain:
    • expression: The mathematical expression (LaTeX)
    • justification: Reason for this step
    • result (optional): Expected result after this step
  • assumptions: Optional list of assumptions about variables

Example:

steps = [
    {
        "expression": r"\int x dx",
        "result": r"\frac{x^2}{2} + C",
        "justification": "Power rule for integration"
    },
    {
        "expression": r"\frac{d}{dx}(\frac{x^2}{2} + C)",
        "result": "x",
        "justification": "Differentiate with respect to x"
    }
]

simplify_expression

Simplify a mathematical expression and optionally show steps.

Parameters:

  • expression (required): Mathematical expression in LaTeX format
  • show_steps: Whether to show intermediate simplification steps (default: true)

Example:

simplify_expression(r"\frac{x^2 - 1}{x - 1}", show_steps=True)

verify_equivalence

Verify if two mathematical expressions are equivalent.

Parameters:

  • expr1 (required): First expression in LaTeX format
  • expr2 (required): Second expression in LaTeX format
  • assumptions: Optional list of assumptions about variables

Example:

verify_equivalence("x^2 - 1", "(x-1)(x+1)")

check_identity

Check if a mathematical identity holds.

Parameters:

  • identity_expr (required): Identity to check (e.g., sin(x)^2 + cos(x)^2 - 1)
  • variable: Variable in the identity (default: 'x')
  • test_values: Optional list of specific values to test

Example:

check_identity(r"\sin^2(x) + \cos^2(x) - 1", variable="x")

verify_derivative

Verify a derivative calculation.

Parameters:

  • expression (required): Expression to differentiate (LaTeX format)
  • variable (required): Variable to differentiate with respect to
  • expected_derivative (required): Expected derivative result (LaTeX format)

Example:

verify_derivative(r"\sin(x) \cos(x)", "x", r"\cos^2(x) - \sin^2(x)")

verify_integral

Verify an integral calculation.

Parameters:

  • expression (required): Expression to integrate (LaTeX format)
  • variable (required): Variable to integrate with respect to
  • expected_integral (required): Expected integral result (LaTeX format)
  • is_definite: Whether this is a definite integral (default: false)
  • lower_limit: Lower limit for definite integral (LaTeX format or number)
  • upper_limit: Upper limit for definite integral (LaTeX format or number)

Examples:

verify_integral("x", "x", r"\frac{x^2}{2} + C", is_definite=False)
verify_integral("x", "x", r"\frac{1}{2}", is_definite=True, lower_limit="0", upper_limit="1")

LaTeX Input Format

The server accepts standard LaTeX mathematical notation:

  • Inline math: x^2, \frac{1}{2}, \sin(x)
  • Functions: \sin(x), \cos(x), \ln(x), \exp(x)
  • Fractions: \frac{numerator}{denominator}
  • Powers: x^2, e^{x}
  • Greek letters: \alpha, \beta, \pi
  • Special symbols: \cdot (multiplication), \int (integral), \frac{d}{dx} (derivative)

Integration Setup

Anki Integration

To use Anki integration:

  1. Install the AnkiConnect addon in Anki
  2. Start Anki with the addon enabled
  3. Use the upload_to_anki or check_anki_connection tools

Zotero Integration

To use Zotero integration:

Option 1: Local Database (Recommended)

  1. Install Zotero desktop application
  2. Use connect_zotero tool with local access
  3. No additional setup required

Option 2: Web API

  1. Get your Zotero API key from zotero.org/settings/keys
  2. Find your user ID from your Zotero profile URL
  3. Use connect_zotero tool with API credentials

Obsidian Integration

To use Obsidian integration:

  1. Locate your Obsidian vault directory
  2. Use connect_obsidian tool with the vault path
  3. The connector will scan and index your notes automatically

Development

Running Tests

uv run pytest

Code Formatting

uv run black src/
uv run isort src/

Type Checking

uv run mypy src/

Configuration with Claude Desktop

Flashcard Server

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "learning": {
      "command": "uv",
      "args": ["run", "fastmcp-flashcard-server"],
      "cwd": "/path/to/mcp-server-learning"
    }
  }
}

Zotero Server

Configure the Zotero FastMCP server:

{
  "mcpServers": {
    "zotero": {
      "command": "uv",
      "args": ["run", "fastmcp-zotero-server"],
      "cwd": "/path/to/mcp-server-learning",
      "env": {
        "ZOTERO_API_KEY": "your-zotero-api-key",
        "ZOTERO_LIBRARY_ID": "your-library-id", 
        "ZOTERO_LIBRARY_TYPE": "user"
      }
    }
  }
}

Obsidian Server

Configure the Obsidian FastMCP server:

{
  "mcpServers": {
    "obsidian": {
      "command": "uv",
      "args": ["run", "fastmcp-obsidian-server"],
      "cwd": "/path/to/mcp-server-learning",
      "env": {
        "OBSIDIAN_VAULT_PATH": "/absolute/path/to/your/Obsidian/Vault"
      }
    }
  }
}

Zotero Environment Variables

You need to set these environment variables for the Zotero server:

  • ZOTERO_API_KEY: Your Zotero Web API key (get from zotero.org/settings/keys)
  • ZOTERO_LIBRARY_ID: Your Zotero library ID
    • For personal library: Your user ID (find in your Zotero profile URL)
    • For group library: The group ID
  • ZOTERO_LIBRARY_TYPE: Either "user" for personal library or "group" for group library

Getting Your Zotero Credentials

  1. API Key: Go to zotero.org/settings/keys and create a new private key
  2. User ID: Go to zotero.org/settings/keys - your user ID is shown at the top
  3. Group ID: For group libraries, the ID is in the group's URL on zotero.org

Obsidian Server

For the standalone Obsidian server, add this to your Claude Desktop configuration:

{
  "mcpServers": {
    "obsidian": {
      "command": "uv",
      "args": ["run", "obsidian-mcp-server"],
      "cwd": "/path/to/mcp-server-learning",
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

Obsidian Environment Variable

You need to set this environment variable for the Obsidian server:

  • OBSIDIAN_VAULT_PATH: Full path to your Obsidian vault directory (the folder containing your .md files and .obsidian folder)

Mathematical Verification Server

Configure the math verification server in Claude Desktop:

{
  "mcpServers": {
    "math-verification": {
      "command": "uv",
      "args": ["run", "fastmcp-math-server"],
      "cwd": "/path/to/mcp-server-learning"
    }
  }
}

This server requires no environment variables - it's ready to use immediately after installation.

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Usage Examples

Basic Flashcard Creation

# Create flashcards from text
create_flashcards(content="Q: What is Python? A: A programming language", card_type="front-back")

# Create cloze deletion cards
create_flashcards(content="Python is a {{programming language}} used for {{web development}}.", card_type="cloze")

Future Features

  • Advanced citation styles (MLA, Chicago, IEEE)
  • Batch processing for large collections
  • Spaced repetition scheduling integration
  • Cross-reference detection between Zotero and Obsidian
  • Support for multimedia flashcards
  • Export to other flashcard platforms
  • Collaborative learning features

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选