teadata-mcp

teadata-mcp

MCP server for exploring Texas public school data through conversational interfaces, enabling campus search, district details, geospatial lookup, comparisons, and transfer insights using TEA data.

Category
访问服务器

README

teadata-mcp

teadata-mcp is a Model Context Protocol server and ChatGPT-ready web app for exploring Texas public school data. It wraps the teadata data engine in a transport and UI layer that works well for ChatGPT apps, internal assistants, and browser-based workflows.

The project is built around a simple idea: make Texas education data usable in conversational interfaces without sacrificing provenance, structure, or operator control.

What the Repository Provides

  • An MCP server with streamable HTTP, WebSocket, and legacy SSE transports
  • A React frontend for ChatGPT-style exploration and inline tool workflows
  • Tools for campus search, district detail, geospatial lookup, comparisons, and transfer insights
  • Widget assets for map and boundary visualization inside supported clients
  • SSO-aware deployment options for pairing a public assistant with a private website workflow

Core Use Cases

  • Build a Texas school-data assistant for ChatGPT or another MCP-capable client
  • Embed school search and boundary workflows in a browser-based assistant UI
  • Support internal research or public-interest analysis with structured TEA data access
  • Pair teadata-app and teadata-mcp so the public website and assistant share the same data model

Highlights

  • Rich campus and district retrieval backed by teadata
  • Fuzzy search across district names, campus names, and identifiers
  • Geospatial tools for nearby campuses and boundary-driven analysis
  • Side-by-side comparison flows for campuses and districts
  • Transfer and mobility insights suitable for charts and narrative summaries
  • Response shaping controls that keep large payloads usable in conversational clients
  • Widget rendering for boundary and explorer workflows in compatible MCP surfaces

Architecture

At a high level, the repository is split into three layers:

  1. teadata data access and domain logic
  2. MCP/server transport and assistant middleware
  3. React frontend and widget assets for browser and ChatGPT experiences

Project Layout

.
├── src/teadata_mcp/
│   ├── logic.py                 # Domain logic built on teadata
│   ├── router.py                # Tool definitions and request routing
│   ├── server.py                # MCP server wiring
│   ├── sse_server.py            # Starlette app / HTTP entrypoint
│   ├── assistant_auth.py        # Shared-token assistant auth helpers
│   ├── assistant_middleware.py  # Browser/API auth behavior
│   ├── tooling_guide.py         # Prompt-to-tool guidance
│   └── widget_assets/           # Inline HTML widget assets
├── frontend/                    # React application for the browser UI
├── tests/                       # Router, logic, auth, and transport tests
├── run_dev.sh                   # Local development launcher
└── Dockerfile                   # Container deployment

Local Development

Fastest Path

./run_dev.sh

This script:

  • syncs Python dependencies with uv
  • installs/builds frontend assets
  • starts the application server

By default the service exposes:

  • http://localhost:<port>/mcp for streamable HTTP MCP
  • ws://localhost:<port>/ws for WebSocket MCP
  • http://localhost:<port>/sse for legacy SSE MCP
  • http://localhost:<port>/ for the browser UI

Manual Backend Setup

uv sync
uv run uvicorn teadata_mcp.sse_server:app --reload --port 8000

Manual Frontend Setup

cd frontend
npm install --legacy-peer-deps
npm run dev

Testing

Run the Python test suite with:

uv run pytest

If you are modifying the frontend or widget behavior, also build the frontend to confirm the static bundle still compiles cleanly.

Deployment

The repository is structured to deploy cleanly to container-friendly platforms such as Render.

Important environment variables:

  • TEADATA_SNAPSHOT: path to a local snapshot
  • TEADATA_SNAPSHOT_URL: remote snapshot URL when the bundled artifact is unavailable
  • TEADATA_MAX_RESPONSE_BYTES: soft response-size cap for list-heavy results
  • PORT: server port supplied by the platform

In production, build the frontend before starting the Python service so the static_dist/ assets are available for browser traffic.

Pairing With teadata-app

teadata-mcp can run as a companion assistant service for teadata-app.

Recommended pattern:

  • keep a website-assistant deployment behind shared-signing-key SSO
  • keep a separate public MCP deployment for ChatGPT or other external clients

This split lets you protect browser access for website users without forcing the same auth model onto non-browser MCP clients.

teadata-app Environment

Set these on the Django application:

  • TEADATA_ASSISTANT_ENABLED=1
  • TEADATA_ASSISTANT_URL
  • TEADATA_ASSISTANT_SSO_SECRET
  • TEADATA_ASSISTANT_COOKIE_DOMAIN
  • TEADATA_ASSISTANT_COOKIE_NAME
  • TEADATA_ASSISTANT_SSO_TTL_SECONDS

teadata-mcp Environment

Set these on the assistant service:

  • TEADATA_ASSISTANT_SSO_SECRET
  • TEADATA_ASSISTANT_COOKIE_NAME
  • TEADATA_ASSISTANT_LAUNCH_URL
  • TEADATA_ASSISTANT_ENFORCE_SSO
  • TEADATA_ASSISTANT_SSO_SKEW_SECONDS
  • TEADATA_DEBUG or DEBUG

Auth Behavior

  • browser UI requests redirect unauthenticated users to the configured launch URL
  • API and MCP transport endpoints return 401 when SSO enforcement is enabled
  • non-browser clients may supply a bearer token instead of a cookie

Working With Large Responses

Texas school data gets large quickly, especially for map and boundary workflows. This repo includes several controls to keep responses useful inside assistant clients:

  • response_profile to choose map-only, list-only, or combined payloads
  • campus_meta_fields / meta_fields to request only the metrics you need
  • campus_list_format to keep list payloads compact
  • pagination plus next_tool_call guidance for follow-up requests
  • export resources for CSV/JSON retrieval when full result sets are too large

If you are designing prompts or integrating a client, use the tooling guide and follow-up calls rather than falling back to web search.

Files Worth Knowing

  • SAMPLE_QUERIES.md: example requests and assistant flows
  • PLAN.md: implementation roadmap / planning notes
  • TODO.md: active task inventory
  • src/teadata_mcp/tooling_guide.py: prompt-routing guidance

Data and Privacy Notes

  • The underlying data is public Texas education data.
  • The service is designed to expose structured public information, not user-specific private records.
  • If you enable SSO or bearer-token protection, secrets should live in environment variables or platform secret stores, never in committed config.

Related Repositories

  • teadata: core Texas education data toolkit
  • teadata-app: companion Django website and SSO launcher

License

Apache License 2.0. See LICENSE.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选