parking-mcp-server
MCP server that securely writes confirmed parking reservations to a file with bearer-token auth and input validation.
README
Parking MCP Server
MCP (Model Context Protocol) server that exposes a tool for writing confirmed parking reservations to a file. Called by the admin agent once an administrator approves a reservation.
Tool
write_reservation(
name: str,
car_number: str,
reservation_period: str, # "start - end"
approval_time: str # ISO timestamp
) -> str # confirmation or error
Appends one line per reservation to data/confirmed_reservations.txt:
Name | Car Number | Reservation Period | Approval Time
Security
- Bearer token auth on every request (
Authorization: Bearer <token>). - Input validation — names, plate numbers, timestamps are validated and rejected if they contain pipe characters or newlines (anti-injection for the delimited file format).
- Append-only, atomic writes — file is opened in append mode with a brief file lock so concurrent writes don't interleave.
- No arbitrary file paths — the output file is fixed by the server config, not by tool arguments.
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# edit .env — change MCP_AUTH_TOKEN
python -m mcp_server.run
# MCP endpoint at http://localhost:8002/mcp
Calling the tool from a Python MCP client
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async def main():
async with streamablehttp_client(
"http://localhost:8002/mcp",
headers={"Authorization": "Bearer change-me-parking-mcp-secret"},
) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
result = await session.call_tool(
"write_reservation",
{"name": "Nikita", "car_number": "BC1234AB",
"reservation_period": "2025-12-01 10:00 - 2025-12-01 12:00",
"approval_time": "2026-08-11T12:00:00Z"},
)
print(result.content[0].text)
asyncio.run(main())
Project layout
mcp_server/
server.py # FastMCP server + tool definition
storage.py # atomic append-only writer with input validation
auth.py # Bearer token middleware
config.py
tests/
test_storage.py
test_server.py
test_auth.py
Tests
pytest -q
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.