Study Assistant
Converts syllabus documents into a searchable study knowledge base. Provides MCP tools to list available syllabi and retrieve structured summaries and extracted text.
README
Study Assistant
A local Model Context Protocol (MCP) server that turns syllabus documents into a searchable study knowledge base. The server reads documents from files/ementas, extracts their text, and uses Genkit with Ollama Cloud to produce summaries and structured details.
Architecture
This repository is a pnpm monorepo. The mcp package contains the Express and MCP server, while files/ementas is the only document directory exposed to the tools.
The server binds to 127.0.0.1 and exposes:
GET /health: process health without secrets or provider details./mcp: stateless MCP Streamable HTTP endpoint.list_ementas: lists supported files with metadata and cached summaries.get_ementa: returns extracted text and structured syllabus details.
Supported formats are PDF, DOCX, Markdown, and plain text. Symbolic links, paths, and unsupported extensions are rejected.
Requirements
- Node.js 20 or newer.
- pnpm 10 (Corepack can provide the pinned version).
- An Ollama Cloud API key.
Setup
Install dependencies from the repository root:
corepack pnpm install
Copy mcp/.env.example to either .env in the repository root or mcp/.env, then provide the API key:
OLLAMA_API_KEY=your-key
The default model is gpt-oss:120b. Optional settings are:
OLLAMA_MODEL=gpt-oss:120b
OLLAMA_BASE_URL=https://ollama.com
OLLAMA_TIMEOUT_MS=60000
MCP_PORT=3000
Environment files are ignored by Git. Never commit an API key.
The application resolves both locations explicitly, regardless of the directory from which pnpm starts the package. Existing system environment variables take precedence; when both files define the same variable, mcp/.env takes precedence over the root .env.
Place syllabus files directly inside files/ementas, then start the development server:
corepack pnpm dev
The MCP endpoint will be available at http://127.0.0.1:3000/mcp.
Connect Codex
With the server running, register its URL in the local Codex client:
codex mcp add studyAssistant --url http://127.0.0.1:3000/mcp
Equivalent Codex configuration:
[mcp_servers.studyAssistant]
url = "http://127.0.0.1:3000/mcp"
This localhost endpoint is intended for a local Codex client. It is not exposed to remote ChatGPT clients.
Commands
Run these commands from the repository root:
corepack pnpm dev # Watch and run the TypeScript server
corepack pnpm build # Build the production JavaScript
corepack pnpm start # Run the compiled server
corepack pnpm typecheck # Check strict TypeScript types
corepack pnpm lint # Run ESLint
corepack pnpm test # Run the Vitest suite
dev and build never run the test suite. Production compilation also excludes src/__tests__, so test fixtures and mocks cannot be loaded by the server or emitted into dist.
Generated analysis is stored in .cache/ementas.json. Cache entries are invalidated when a document's size or modification time changes. A valid cached result remains usable if Ollama Cloud is temporarily unavailable.
Security and failure behavior
The API key is loaded from the environment and sent only in the Ollama authorization header. It is not included in health responses, MCP responses, or application logs. Cloud requests use a timeout and retry transient 429, 500, and 502 failures. A failure in one file is isolated in list_ementas; get_ementa reports an MCP tool error.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。