Skip to content

Commit 037c5f0

Browse files
committed
implement tools
1 parent 202db08 commit 037c5f0

File tree

27 files changed

+599
-0
lines changed

27 files changed

+599
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Contributing Guidelines
2+
3+
- Fork the project on GitHub.
4+
- Make your feature addition or bug fix in a branch. Example branches: (`feature/name`) / (`fix/name`).
5+
- Push your branch to GitHub.
6+
- Send a Pull Request. Include a description of your changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Bug report
2+
description: Create a bug report
3+
labels: ["bug"]
4+
body:
5+
- type: textarea
6+
id: what-happened
7+
attributes:
8+
label: What happened?
9+
validations:
10+
required: true

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Telegram
3+
url: https://t.me/TuanKiri
4+
about: For questions, feedback and support!
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Feature request
2+
description: Suggest an idea for this project
3+
labels: ["enhancement"]
4+
body:
5+
- type: textarea
6+
id: problem
7+
attributes:
8+
label: The problem
9+
description: Describe what problem you would like to see solved.
10+
validations:
11+
required: true

.github/SECURITY.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Security Policy
2+
3+
If you discover a security issue, please bring it to our attention right away!
4+
5+
## Reporting a Vulnerability
6+
7+
Please **DO NOT** file a public issue to report a security vulberability, instead send your report privately to **[email protected]**.

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: monthly
7+
- package-ecosystem: github-actions
8+
directory: /
9+
schedule:
10+
interval: monthly

.github/workflows/go.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
on: [push, pull_request]
2+
name: Build
3+
4+
jobs:
5+
build:
6+
strategy:
7+
matrix:
8+
platform: [ubuntu-latest, windows-latest, macos-latest]
9+
runs-on: ${{ matrix.platform }}
10+
steps:
11+
- name: Check out code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Go
15+
uses: actions/setup-go@v5
16+
with:
17+
go-version-file: "go.mod"
18+
19+
- name: Download dependencies
20+
run: go mod download
21+
22+
- name: Build
23+
run: go build -v ./cmd/weather-mcp-server

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<div align="center">
2+
<img alt="example output template" src="./assets/weather.svg">
3+
4+
<h1>Weather API MCP Server</h1>
5+
6+
[![license](https://img.shields.io/badge/license-MIT-red.svg)](LICENSE)
7+
[![go version](https://img.shields.io/github/go-mod/go-version/TuanKiri/weather-mcp-server)](go.mod)
8+
[![go report](https://goreportcard.com/badge/github.com/TuanKiri/weather-mcp-server)](https://goreportcard.com/report/github.com/TuanKiri/weather-mcp-server)
9+
10+
<strong>[Report Bug](https://github.com/TuanKiri/weather-mcp-server/issues/new?assignees=&labels=bug&projects=&template=bug_report.yml)</strong> | <strong>[Request Feature](https://github.com/TuanKiri/weather-mcp-server/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml)</strong>
11+
12+
</div>
13+
14+
A lightweight Model Context Protocol (MCP) server that enables AI assistants like Claude to retrieve and interpret real-time weather data.
15+
16+
<div align="center">
17+
<img alt="demo example" src="./assets/weather.gif" width="480">
18+
</div>
19+
20+
## Installing on Claude Desktop
21+
22+
To use your MCP server with Claude Desktop, add it to your Claude configuration:
23+
24+
```json
25+
{
26+
"mcpServers": {
27+
"weather-mcp-server": {
28+
"command": "/path/to/weather-mcp-server",
29+
"args": [],
30+
"env": {
31+
"WEATHER_API_KEY": "your-api-key"
32+
}
33+
}
34+
}
35+
}
36+
```
37+
38+
You can get your API key in your personal account at [weatherapi](https://www.weatherapi.com/my/).
39+
40+
## Build from source
41+
42+
You can use `go` to build the binary in the `cmd/github-mcp-server` directory.
43+
44+
```shell
45+
go build -o weather-mcp-server ./cmd/weather-mcp-server
46+
```
47+
48+
## Tools
49+
50+
- **current_weather** - Gets the current weather for a city
51+
52+
- `city`: The name of the city (string, required)
53+
54+
## Project Structure
55+
56+
The project is organized into several key directories:
57+
58+
```shell
59+
├── cmd
60+
│ └── weather-mcp-server
61+
├── internal
62+
│ └── server
63+
│ ├── handlers # MCP handlers
64+
│ ├── services # Business logic layer
65+
│ │ ├── core # Core application logic
66+
│ │ └── mock # Mock services for testing
67+
│ ├── tools # MCP tools
68+
│ └── view # Templates for displaying messages
69+
└── pkg
70+
```
71+
72+
## Contributing
73+
74+
Feel free to open tickets or send pull requests with improvements. Thanks in advance for your help!
75+
76+
Please follow the [contribution guidelines](.github/CONTRIBUTING.md).
77+
78+
## License
79+
80+
This MCP server is licensed under the MIT License.

assets/weather.gif

93.7 KB
Loading

0 commit comments

Comments
 (0)