SmartPark Reservation MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SmartPark Reservation MCP ServerSave the confirmed reservation for Maria (plate XYZ789) from 1-3pm today."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SmartPark Reservation MCP Server — Stage 3
A real MCP (Model Context Protocol) server, built with the official
mcp Python SDK, that writes confirmed parking reservations to durable
storage once a human administrator has approved them (Stage 2).
This is a separate repository/service from Stages 1 and 2 — Agent 2 calls this server's single tool over the network, the same way any MCP-compliant client would.
What it does
Exposes exactly one MCP tool: write_confirmed_reservation. Once
the administrator (Agent 2) approves a reservation, Agent 2 calls this
tool, which:
Validates every field (rejects the
|delimiter, newlines, null bytes, and overly long values — these would corrupt the file format or let a caller inject a fake extra record).Appends one line to
data/confirmed_reservations.txtin the exact required format:Name | Car Number | Reservation Period | Approval TimeDoes this atomically and safely under concurrent calls (cross-platform file locking), and logs the attempt (success or rejection) to an audit log.
Related MCP server: Kaiza MCP Server
Architecture
Agent 2 (Stage 2 Admin Agent) Agent 3 (this repo)
┌──────────────────────────┐ MCP/HTTP ┌────────────────────────────┐
│ apply_decision(confirmed) │ ────────────▶ │ POST /mcp │
│ │ Bearer token │ BearerAuthMiddleware │
│ integration/ │ required │ RateLimitMiddleware │
│ admin_agent_client.py │ │ MCPServer │
│ -> record_confirmed_ │ │ └─ write_confirmed_ │
│ reservation() │ │ reservation tool │
└──────────────────────────┘ │ └─ validate ─┐ │
│ ▼ │
│ data/confirmed_ │
│ reservations.txt │
│ (file-locked append) │
│ + data/audit.log │
└────────────────────────────┘Why the official MCP SDK (not just a REST endpoint)
Stage 3 asks for a real MCP server, or a FastAPI stand-in if that's not
feasible. The official mcp Python SDK (MCPServer, formerly known as
FastMCP) turned out to be fully usable here: it builds a standard
streamable-HTTP ASGI app (so it composes with normal Starlette middleware
for auth/rate-limiting) and ships with production security features out
of the box — DNS-rebinding protection, host/origin allowlisting, and
request-body size limits — which is exactly what "secure and resistant to
unauthorized access" calls for. Building a hand-rolled JSON-RPC-over-FastAPI
server would have meant re-implementing a worse version of these same
protections.
Security measures
Concern | Mitigation |
Unauthorized callers |
|
Abuse / DoS |
|
DNS rebinding / host spoofing | The MCP SDK's built-in |
Path traversal | Structurally impossible — the output file path is fixed by server config and is never accepted as a tool argument. |
Record/format injection | Every field is validated to reject the ` |
Concurrent-write corruption | Cross-platform atomic file locking ( |
Oversized/malformed requests |
|
Traceability without leaking secrets | Every write attempt (success or rejection) is appended to |
Reliability | A stuck lock surfaces as a clear, catchable |
Project structure
parking_mcp_server/
├── app/
│ ├── config.py # .env-driven configuration
│ ├── reservation_writer.py # field validation + atomic file append
│ ├── audit_log.py # append-only audit trail
│ ├── security.py # BearerAuthMiddleware, RateLimitMiddleware
│ └── server.py # MCPServer + tool + ASGI wiring
├── integration/
│ ├── admin_agent_client.py # what Stage 2 imports to call this server
│ └── db_patch_example.py # exact diff for Stage 2's decision endpoint
├── tests/ # 22 pytest tests across 4 modules
├── demo.py # end-to-end demo (live server + real MCP client)
├── view_reservations.py # quick CLI viewer for the output file/audit log
├── run_server.sh / run_server.ps1
├── requirements.txt
├── .env.example
└── .github/workflows/ci.yml # runs tests on both ubuntu-latest and windows-latestSetup
Works identically on Windows, macOS, and Linux — pure Python (the
official mcp SDK, Starlette/uvicorn, and the cross-platform filelock
package; no OS-specific binaries).
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Set MCP_API_KEY in .env for a stable key -- otherwise a random one-time
# key is generated and printed at startup.Windows-specific notes
Use
run_server.ps1instead ofrun_server.sh.filelockusesmsvcrtunder the hood on Windows automatically — no extra configuration needed for the concurrency-safety guarantees.CI runs the full test suite on
windows-latestas well asubuntu-latest(see.github/workflows/ci.yml).
Usage
Run the demo (starts its own server, no setup needed):
PYTHONPATH=. python demo.pyRun the real server:
./run_server.sh # Linux/macOS
.\run_server.ps1 # WindowsIt prints a generated MCP_API_KEY on first run if you haven't set one —
copy it into your client's Authorization: Bearer <key> header (or into
Stage 2's .env as MCP_API_KEY, see Integration below).
View what's been written:
PYTHONPATH=. python view_reservations.pyRun tests:
PYTHONPATH=. python -m pytest tests/ -vIntegration with Agent 2 (Stage 2)
integration/admin_agent_client.py— the client Stage 2 imports (record_confirmed_reservation(name, car_number, reservation_period, approval_time)), which opens a real MCP client session, authenticates, and calls the tool.integration/db_patch_example.py— the exact before/after diff for Stage 2'sPOST /requests/{id}/decisionendpoint: once a reservation is marked"confirmed", it now also callsrecord_confirmed_reservation(...)so the approval is durably recorded here, not just in Stage 2's own request-tracking table.Stage 2's
.envneeds:MCP_SERVER_URL=http://127.0.0.1:8002/mcpandMCP_API_KEY=<the same key configured on this server>.
Notes / limitations (Stage 3 scope)
Rate limiting and the audit log are in-memory/local-file, appropriate for a single-process deployment; a multi-instance deployment would move the rate limiter to a shared store (e.g. Redis) and the audit log to a centralized logging system.
MCP_API_KEYis a single shared secret rather than per-client credentials — sufficient for a single trusted caller (Agent 2), but a multi-tenant deployment would want per-client tokens or the MCP SDK's full OAuth 2.1 support (auth_server_provider/AuthSettings, not used here since it requires standing up a separate OAuth issuer).The reservations file is a flat text file, as specified; a higher-volume production deployment would likely write to a database instead, behind the same tool interface.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceEnables safe file system operations including reading, writing, updating, and deleting files with built-in security safeguards, automatic backups, and comprehensive error handling. Provides directory listing, file metadata extraction, and protects against operations on system-critical paths.
- Alicense-quality-maintenanceEnables secure, audited file operations with LLMs by enforcing implementation plans, restricting writes to approved file scopes, and maintaining a tamper-evident audit log with stub detection.270
- Flicense-qualityDmaintenanceProvides secure file read, write, and edit operations for Windows, with enterprise-grade features like atomic writes, file locking, and path validation.
- Flicense-qualityCmaintenanceRecords approved parking reservations to a secure text file via the Model Context Protocol, with token authentication and input sanitization.
Related MCP Connectors
Immutable event logging and audit trail for agent transactions
Tamper-evident audit log service for agent-to-agent transactions
Copilot connector permission audits with owner signoff receipts.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/polloter130/Process-confirmed-reservation-by-using-MCP-server-STAGE-3'
If you have feedback or need assistance with the MCP directory API, please join our Discord server