This is a simple Model Context Protocol (MCP) demo focused on weather functionality using Encore. The code is extremely typed, well-documented with JSDocs, follows SOLID principles, and incorporates Test-Driven Development (TDD).
- Weather service that provides current weather information for cities
- MCP server implementation using the Model Context Protocol SDK
- Type-safe API with Zod schema validation
- Comprehensive test suite using Vitest
- macOS:
brew install encoredev/tap/encore
- Linux:
curl -L https://encore.dev/install.sh | bash
- Windows:
iwr https://encore.dev/install.ps1 | iex
Create a local app from this template:
encore app create --example=ts/mcp-example
## Running locally
```bash
encore run
While encore run
is running, open http://localhost:9400/ to view Encore's local developer dashboard.
encore test
# Run the MCP client test script
./scripts/run-mcp-test.sh
This demo implements the following MCP tools:
get-weather
: Get the current weather for a specified city
Deploy your application to a staging environment in Encore's free development cloud:
git add -A .
git commit -m 'Commit message'
git push encore
Then head over to the Cloud Dashboard to monitor your deployment and find your production URL.
From there you can also connect your own AWS or GCP account to use for deployment.
author: @leofmarciano