@ryancardin/noaa-tides-currents-mcp-server 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +29 -0
- package/CLAUDE.md +71 -0
- package/Dockerfile +14 -0
- package/LICENSE +21 -0
- package/README.md +234 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -0
- package/dist/interfaces/config.d.ts +6 -0
- package/dist/interfaces/config.js +1 -0
- package/dist/interfaces/moon.d.ts +65 -0
- package/dist/interfaces/moon.js +35 -0
- package/dist/interfaces/noaa.d.ts +334 -0
- package/dist/interfaces/noaa.js +98 -0
- package/dist/interfaces/parameters.d.ts +18 -0
- package/dist/interfaces/parameters.js +5 -0
- package/dist/interfaces/sun.d.ts +103 -0
- package/dist/interfaces/sun.js +45 -0
- package/dist/mcp-server.d.ts +12 -0
- package/dist/mcp-server.js +103 -0
- package/dist/moon-phase-service.d.ts +122 -0
- package/dist/moon-phase-service.js +187 -0
- package/dist/noaa-service.d.ts +60 -0
- package/dist/noaa-service.js +159 -0
- package/dist/schemas/common.d.ts +14 -0
- package/dist/schemas/common.js +18 -0
- package/dist/schemas/dpapi.d.ts +198 -0
- package/dist/schemas/dpapi.js +89 -0
- package/dist/server/config.d.ts +9 -0
- package/dist/server/config.js +40 -0
- package/dist/server/mcp-server.d.ts +12 -0
- package/dist/server/mcp-server.js +103 -0
- package/dist/services/dpapi-service.d.ts +72 -0
- package/dist/services/dpapi-service.js +164 -0
- package/dist/services/moon-phase-service.d.ts +34 -0
- package/dist/services/moon-phase-service.js +147 -0
- package/dist/services/noaa-parameters-service.d.ts +76 -0
- package/dist/services/noaa-parameters-service.js +128 -0
- package/dist/services/noaa-service.d.ts +52 -0
- package/dist/services/noaa-service.js +151 -0
- package/dist/services/sun-service.d.ts +60 -0
- package/dist/services/sun-service.js +234 -0
- package/dist/sun-service.d.ts +184 -0
- package/dist/sun-service.js +218 -0
- package/dist/tools/derived-product-tools.d.ts +6 -0
- package/dist/tools/derived-product-tools.js +168 -0
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/index.js +36 -0
- package/dist/tools/moon-tools.d.ts +6 -0
- package/dist/tools/moon-tools.js +69 -0
- package/dist/tools/parameter-tools.d.ts +6 -0
- package/dist/tools/parameter-tools.js +77 -0
- package/dist/tools/station-tools.d.ts +6 -0
- package/dist/tools/station-tools.js +51 -0
- package/dist/tools/sun-tools.d.ts +6 -0
- package/dist/tools/sun-tools.js +109 -0
- package/dist/tools/water-tools.d.ts +6 -0
- package/dist/tools/water-tools.js +150 -0
- package/dist/types/moon.d.ts +26 -0
- package/dist/types/moon.js +14 -0
- package/dist/types/sun.d.ts +49 -0
- package/dist/types/sun.js +19 -0
- package/dist/types.d.ts +337 -0
- package/dist/types.js +98 -0
- package/package.json +56 -0
- package/smithery.yaml +16 -0
- package/src/index.ts +13 -0
- package/src/interfaces/moon.ts +44 -0
- package/src/interfaces/noaa.ts +130 -0
- package/src/interfaces/parameters.ts +20 -0
- package/src/interfaces/sun.ts +57 -0
- package/src/schemas/common.ts +23 -0
- package/src/schemas/dpapi.ts +99 -0
- package/src/server/config.ts +43 -0
- package/src/server/mcp-server.ts +135 -0
- package/src/services/dpapi-service.ts +187 -0
- package/src/services/moon-phase-service.ts +167 -0
- package/src/services/noaa-parameters-service.ts +139 -0
- package/src/services/noaa-service.ts +171 -0
- package/src/services/sun-service.ts +275 -0
- package/src/tools/derived-product-tools.ts +180 -0
- package/src/tools/index.ts +40 -0
- package/src/tools/moon-tools.ts +79 -0
- package/src/tools/parameter-tools.ts +82 -0
- package/src/tools/station-tools.ts +57 -0
- package/src/tools/sun-tools.ts +120 -0
- package/src/tools/water-tools.ts +166 -0
- package/src/types/moon.ts +27 -0
- package/src/types/sun.ts +51 -0
- package/src/types/suncalc.d.ts +110 -0
- package/test-dpapi.js +0 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"permissions": {
|
|
3
|
+
"allow": [
|
|
4
|
+
"WebFetch(domain:tidesandcurrents.noaa.gov)",
|
|
5
|
+
"WebFetch(domain:api.tidesandcurrents.noaa.gov)",
|
|
6
|
+
"WebFetch(domain:www.tidesandcurrents.noaa.gov)",
|
|
7
|
+
"WebFetch(domain:gofastmcp.com)",
|
|
8
|
+
"WebFetch(domain:github.com)",
|
|
9
|
+
"WebFetch(domain:deepwiki.com)",
|
|
10
|
+
"Bash(npm run build:*)",
|
|
11
|
+
"Bash(npx fastmcp inspect:*)",
|
|
12
|
+
"Bash(ls:*)",
|
|
13
|
+
"Bash(node:*)",
|
|
14
|
+
"Bash(npm test)",
|
|
15
|
+
"Bash(rm:*)",
|
|
16
|
+
"Bash(bash -c \"git status\")",
|
|
17
|
+
"Bash(export:*)",
|
|
18
|
+
"Bash(/usr/bin/git status)",
|
|
19
|
+
"Bash(exec /bin/bash -c \"git checkout -b feature/testing-branch\")",
|
|
20
|
+
"Bash(git checkout:*)",
|
|
21
|
+
"Bash(git add:*)",
|
|
22
|
+
"Bash(git commit:*)",
|
|
23
|
+
"Bash(npx @modelcontextprotocol/inspector:*)",
|
|
24
|
+
"Bash(chmod:*)",
|
|
25
|
+
"Bash(npm pack:*)"
|
|
26
|
+
],
|
|
27
|
+
"deny": []
|
|
28
|
+
}
|
|
29
|
+
}
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Development Commands
|
|
6
|
+
|
|
7
|
+
### Building and Running
|
|
8
|
+
- `npm run build` - Build TypeScript to JavaScript in `dist/` directory
|
|
9
|
+
- `npm start` - Start the MCP server (requires build first)
|
|
10
|
+
- `npm run dev` - Run in development mode with ts-node-esm
|
|
11
|
+
- `npm run format` - Format code with Prettier
|
|
12
|
+
- `npm test` - Run tests with Vitest
|
|
13
|
+
|
|
14
|
+
### Testing and Development
|
|
15
|
+
- `npx fastmcp dev dist/index.js` - Test server with fastmcp CLI
|
|
16
|
+
- `npx fastmcp inspect dist/index.js` - Inspect server capabilities
|
|
17
|
+
|
|
18
|
+
## Architecture Overview
|
|
19
|
+
|
|
20
|
+
This is a FastMCP server that provides tools for accessing NOAA Tides and Currents data, moon phase information, and sun position calculations.
|
|
21
|
+
|
|
22
|
+
### Core Structure
|
|
23
|
+
- **Entry Point**: `src/index.ts` - Creates server, registers tools, and starts stdio transport
|
|
24
|
+
- **Server Configuration**: `src/server/config.ts` - FastMCP server setup with fixed stdio transport
|
|
25
|
+
- **Tool Registration**: `src/tools/index.ts` - Centralized tool registration hub
|
|
26
|
+
|
|
27
|
+
### Service Layer
|
|
28
|
+
The application follows a service-oriented architecture:
|
|
29
|
+
- `NoaaService` - Handles all NOAA API interactions (data and metadata APIs)
|
|
30
|
+
- `MoonPhaseService` - Calculates moon phases and lunar information
|
|
31
|
+
- `SunService` - Calculates sun position, rise/set times using suncalc library
|
|
32
|
+
- `NoaaParametersService` - Provides parameter definitions for NOAA API
|
|
33
|
+
|
|
34
|
+
### Tool Categories
|
|
35
|
+
Tools are organized by functional area:
|
|
36
|
+
- **Water Tools** (`water-tools.ts`) - Water levels, tide predictions, currents
|
|
37
|
+
- **Station Tools** (`station-tools.ts`) - Station metadata and information
|
|
38
|
+
- **Moon Tools** (`moon-tools.ts`) - Moon phase calculations
|
|
39
|
+
- **Sun Tools** (`sun-tools.ts`) - Sun position and event calculations
|
|
40
|
+
- **Parameter Tools** (`parameter-tools.ts`) - API parameter definitions
|
|
41
|
+
|
|
42
|
+
### Data Validation
|
|
43
|
+
- Uses Zod schemas for parameter validation in `src/schemas/common.ts`
|
|
44
|
+
- Common validation patterns for dates, stations, units, formats, etc.
|
|
45
|
+
- Refined validation for date parameter combinations
|
|
46
|
+
|
|
47
|
+
### API Integration
|
|
48
|
+
- **NOAA Data API**: `https://api.tidesandcurrents.noaa.gov/api/prod/datagetter`
|
|
49
|
+
- **NOAA Metadata API**: `https://api.tidesandcurrents.noaa.gov/mdapi/prod/webapi`
|
|
50
|
+
- Uses axios for HTTP requests with proper error handling
|
|
51
|
+
|
|
52
|
+
### Key Dependencies
|
|
53
|
+
- `fastmcp` - MCP server framework
|
|
54
|
+
- `axios` - HTTP client for NOAA API calls
|
|
55
|
+
- `suncalc` - Sun position and timing calculations
|
|
56
|
+
- `zod` - Schema validation
|
|
57
|
+
- TypeScript with ES modules and Node16 module resolution
|
|
58
|
+
|
|
59
|
+
## Important Implementation Notes
|
|
60
|
+
|
|
61
|
+
### MCP Server Configuration
|
|
62
|
+
The server uses stdio transport exclusively - do not modify to use other transports as this is designed for MCP client integration.
|
|
63
|
+
|
|
64
|
+
### Error Handling
|
|
65
|
+
NOAA API errors are caught and re-thrown with structured error messages including status codes and response data.
|
|
66
|
+
|
|
67
|
+
### Date Handling
|
|
68
|
+
The codebase supports multiple date formats and has specific validation logic for date parameter combinations (date vs begin_date/end_date).
|
|
69
|
+
|
|
70
|
+
### Tool Organization
|
|
71
|
+
Each tool category has its own registration function that accepts the server instance and relevant service(s). This modular approach makes it easy to add new tools or modify existing ones.
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
|
|
2
|
+
FROM node:lts-alpine
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Install dependencies
|
|
6
|
+
COPY package*.json ./
|
|
7
|
+
RUN npm install --ignore-scripts
|
|
8
|
+
|
|
9
|
+
# Copy source code and build the project
|
|
10
|
+
COPY . .
|
|
11
|
+
RUN npm run build
|
|
12
|
+
|
|
13
|
+
# Start the server in stdio mode
|
|
14
|
+
CMD [ "npm", "start" ]
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ryan Cardin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# LocalTides MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://smithery.ai/server/@RyanCardin15/noaa-tidesandcurrents-mcp)
|
|
4
|
+
|
|
5
|
+
This is an MCP (Model Context Protocol) server that provides tools for interacting with the NOAA Tides and Currents API using the FastMCP framework.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Water Level data retrieval (real-time and historical)
|
|
10
|
+
- Tide Predictions (high/low or interval-based)
|
|
11
|
+
- Currents data (real-time and historical)
|
|
12
|
+
- Current predictions
|
|
13
|
+
- Station metadata retrieval
|
|
14
|
+
- Wind, air temperature, water temperature, and other meteorological data
|
|
15
|
+
- Moon phase information (past, present, and future)
|
|
16
|
+
- Sun rise/set and position data (past, present, and future)
|
|
17
|
+
|
|
18
|
+
## Prerequisites
|
|
19
|
+
|
|
20
|
+
- Node.js (v18 or higher)
|
|
21
|
+
- npm or yarn
|
|
22
|
+
|
|
23
|
+
## Setup
|
|
24
|
+
|
|
25
|
+
### Installing via Smithery
|
|
26
|
+
|
|
27
|
+
To install NOAA Tides and Currents for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@RyanCardin15/tidesandcurrents):
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx -y @smithery/cli install @RyanCardin15/tidesandcurrents --client claude
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Manual Installation
|
|
34
|
+
1. Clone this repository
|
|
35
|
+
2. Install dependencies
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
3. Build the TypeScript code
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm run build
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
4. Start the server
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm start
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
This MCP server can be used with any MCP host such as Claude Desktop, which allows you to use the NOAA Tides and Currents API through the MCP protocol.
|
|
56
|
+
|
|
57
|
+
You can also test it directly using the `fastmcp` command-line tool:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx fastmcp dev dist/index.js
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or, you can use the MCP Inspector:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx fastmcp inspect dist/index.js
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Available Tools
|
|
70
|
+
|
|
71
|
+
#### Parameter Definitions
|
|
72
|
+
|
|
73
|
+
- `get_parameter_definitions` - Get information about valid parameter values for NOAA API requests
|
|
74
|
+
- Parameters:
|
|
75
|
+
- `parameter` (string, optional) - Parameter type to get information about (time_zones, datums, units, tide_intervals, current_intervals, velocity_types, products, station_types, date_formats, output_formats). If not provided, returns information about all parameter types.
|
|
76
|
+
|
|
77
|
+
#### Water Levels
|
|
78
|
+
|
|
79
|
+
- `get_water_levels` - Get water level data for a station
|
|
80
|
+
- Parameters:
|
|
81
|
+
- `station` (string) - Station ID
|
|
82
|
+
- `date` (string, optional) - Date to retrieve data for ("today", "latest", "recent", or specific date)
|
|
83
|
+
- `begin_date` (string, optional) - Start date (YYYYMMDD or MM/DD/YYYY)
|
|
84
|
+
- `end_date` (string, optional) - End date (YYYYMMDD or MM/DD/YYYY)
|
|
85
|
+
- `range` (number, optional) - Number of hours to retrieve data for
|
|
86
|
+
- `datum` (string, optional) - Datum to use (MLLW, MSL, etc.)
|
|
87
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
88
|
+
- `time_zone` (string, optional) - Time zone (gmt, lst, lst_ldt)
|
|
89
|
+
- `format` (string, optional) - Output format (json, xml, csv)
|
|
90
|
+
|
|
91
|
+
#### Tide Predictions
|
|
92
|
+
|
|
93
|
+
- `get_tide_predictions` - Get tide prediction data
|
|
94
|
+
- Parameters:
|
|
95
|
+
- `station` (string) - Station ID
|
|
96
|
+
- `begin_date` (string) - Start date (YYYYMMDD or MM/DD/YYYY)
|
|
97
|
+
- `end_date` (string) - End date (YYYYMMDD or MM/DD/YYYY)
|
|
98
|
+
- `datum` (string, optional) - Datum to use (MLLW, MSL, etc.)
|
|
99
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
100
|
+
- `time_zone` (string, optional) - Time zone (gmt, lst, lst_ldt)
|
|
101
|
+
- `interval` (string, optional) - Interval (hilo, hl, h, or a number for minutes)
|
|
102
|
+
- `format` (string, optional) - Output format (json, xml, csv)
|
|
103
|
+
|
|
104
|
+
#### Currents
|
|
105
|
+
|
|
106
|
+
- `get_currents` - Get currents data for a station
|
|
107
|
+
- Parameters:
|
|
108
|
+
- `station` (string) - Station ID
|
|
109
|
+
- `date` (string, optional) - Date to retrieve data for ("today", "latest", "recent", or specific date)
|
|
110
|
+
- `begin_date` (string, optional) - Start date (YYYYMMDD or MM/DD/YYYY)
|
|
111
|
+
- `end_date` (string, optional) - End date (YYYYMMDD or MM/DD/YYYY)
|
|
112
|
+
- `bin` (number, optional) - Bin number
|
|
113
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
114
|
+
- `time_zone` (string, optional) - Time zone (gmt, lst, lst_ldt)
|
|
115
|
+
- `format` (string, optional) - Output format (json, xml, csv)
|
|
116
|
+
|
|
117
|
+
#### Current Predictions
|
|
118
|
+
|
|
119
|
+
- `get_current_predictions` - Get current predictions
|
|
120
|
+
- Parameters:
|
|
121
|
+
- `station` (string) - Station ID
|
|
122
|
+
- `date` (string, optional) - Date to retrieve data for ("today", "latest", "recent", or specific date)
|
|
123
|
+
- `begin_date` (string, optional) - Start date (YYYYMMDD or MM/DD/YYYY)
|
|
124
|
+
- `end_date` (string, optional) - End date (YYYYMMDD or MM/DD/YYYY)
|
|
125
|
+
- `bin` (number, optional) - Bin number
|
|
126
|
+
- `interval` (string, optional) - Interval (MAX_SLACK or a number for minutes)
|
|
127
|
+
- `vel_type` (string, optional) - Velocity type (speed_dir or default)
|
|
128
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
129
|
+
- `time_zone` (string, optional) - Time zone (gmt, lst, lst_ldt)
|
|
130
|
+
- `format` (string, optional) - Output format (json, xml, csv)
|
|
131
|
+
|
|
132
|
+
#### Meteorological Data
|
|
133
|
+
|
|
134
|
+
- `get_meteorological_data` - Get meteorological data
|
|
135
|
+
- Parameters:
|
|
136
|
+
- `station` (string) - Station ID
|
|
137
|
+
- `product` (string) - Product (air_temperature, wind, etc.)
|
|
138
|
+
- `date` (string, optional) - Date to retrieve data for ("today", "latest", "recent", or specific date)
|
|
139
|
+
- `begin_date` (string, optional) - Start date (YYYYMMDD or MM/DD/YYYY)
|
|
140
|
+
- `end_date` (string, optional) - End date (YYYYMMDD or MM/DD/YYYY)
|
|
141
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
142
|
+
- `time_zone` (string, optional) - Time zone (gmt, lst, lst_ldt)
|
|
143
|
+
- `format` (string, optional) - Output format (json, xml, csv)
|
|
144
|
+
|
|
145
|
+
#### Station Information
|
|
146
|
+
|
|
147
|
+
- `get_stations` - Get list of stations
|
|
148
|
+
- Parameters:
|
|
149
|
+
- `type` (string, optional) - Station type (waterlevels, currents, etc.)
|
|
150
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
151
|
+
- `format` (string, optional) - Output format (json, xml)
|
|
152
|
+
|
|
153
|
+
- `get_station_details` - Get detailed information about a station
|
|
154
|
+
- Parameters:
|
|
155
|
+
- `station` (string) - Station ID
|
|
156
|
+
- `units` (string, optional) - Units to use ("english" or "metric")
|
|
157
|
+
- `format` (string, optional) - Output format (json, xml)
|
|
158
|
+
|
|
159
|
+
#### Moon Phase Information
|
|
160
|
+
|
|
161
|
+
- `get_moon_phase` - Get moon phase information for a specific date
|
|
162
|
+
- Parameters:
|
|
163
|
+
- `date` (string, optional) - Date to get moon phase for (YYYY-MM-DD format). Defaults to current date.
|
|
164
|
+
- `latitude` (number, optional) - Latitude for location-specific calculations
|
|
165
|
+
- `longitude` (number, optional) - Longitude for location-specific calculations
|
|
166
|
+
- `format` (string, optional) - Output format (json or text)
|
|
167
|
+
|
|
168
|
+
- `get_moon_phases_range` - Get moon phase information for a date range
|
|
169
|
+
- Parameters:
|
|
170
|
+
- `start_date` (string) - Start date (YYYY-MM-DD format)
|
|
171
|
+
- `end_date` (string) - End date (YYYY-MM-DD format)
|
|
172
|
+
- `latitude` (number, optional) - Latitude for location-specific calculations
|
|
173
|
+
- `longitude` (number, optional) - Longitude for location-specific calculations
|
|
174
|
+
- `format` (string, optional) - Output format (json or text)
|
|
175
|
+
|
|
176
|
+
- `get_next_moon_phase` - Get the next occurrence(s) of a specific moon phase
|
|
177
|
+
- Parameters:
|
|
178
|
+
- `phase` (string) - Moon phase to find (New Moon, First Quarter, Full Moon, Last Quarter)
|
|
179
|
+
- `date` (string, optional) - Starting date (YYYY-MM-DD format). Defaults to current date.
|
|
180
|
+
- `count` (number, optional) - Number of occurrences to return. Defaults to 1.
|
|
181
|
+
- `format` (string, optional) - Output format (json or text)
|
|
182
|
+
|
|
183
|
+
#### Sun Rise/Set Information
|
|
184
|
+
|
|
185
|
+
- `get_sun_times` - Get sun rise/set and other sun event times for a specific date and location
|
|
186
|
+
- Parameters:
|
|
187
|
+
- `date` (string, optional) - Date to get sun times for (YYYY-MM-DD format). Defaults to current date.
|
|
188
|
+
- `latitude` (number) - Latitude for location-specific calculations
|
|
189
|
+
- `longitude` (number) - Longitude for location-specific calculations
|
|
190
|
+
- `format` (string, optional) - Output format (json or text)
|
|
191
|
+
- `timezone` (string, optional) - Timezone for the results. Defaults to UTC.
|
|
192
|
+
|
|
193
|
+
- `get_sun_times_range` - Get sun rise/set and other sun event times for a date range and location
|
|
194
|
+
- Parameters:
|
|
195
|
+
- `start_date` (string) - Start date (YYYY-MM-DD format)
|
|
196
|
+
- `end_date` (string) - End date (YYYY-MM-DD format)
|
|
197
|
+
- `latitude` (number) - Latitude for location-specific calculations
|
|
198
|
+
- `longitude` (number) - Longitude for location-specific calculations
|
|
199
|
+
- `format` (string, optional) - Output format (json or text)
|
|
200
|
+
- `timezone` (string, optional) - Timezone for the results. Defaults to UTC.
|
|
201
|
+
|
|
202
|
+
- `get_sun_position` - Get sun position information for a specific date, time, and location
|
|
203
|
+
- Parameters:
|
|
204
|
+
- `date` (string, optional) - Date to get sun position for (YYYY-MM-DD format). Defaults to current date.
|
|
205
|
+
- `time` (string, optional) - Time to get sun position for (HH:MM:SS format). Defaults to current time.
|
|
206
|
+
- `latitude` (number) - Latitude for location-specific calculations
|
|
207
|
+
- `longitude` (number) - Longitude for location-specific calculations
|
|
208
|
+
- `format` (string, optional) - Output format (json or text)
|
|
209
|
+
|
|
210
|
+
- `get_next_sun_event` - Get the next occurrence(s) of a specific sun event
|
|
211
|
+
- Parameters:
|
|
212
|
+
- `event` (string) - Sun event to find (sunrise, sunset, dawn, dusk, solarNoon, etc.)
|
|
213
|
+
- `date` (string, optional) - Starting date (YYYY-MM-DD format). Defaults to current date.
|
|
214
|
+
- `latitude` (number) - Latitude for location-specific calculations
|
|
215
|
+
- `longitude` (number) - Longitude for location-specific calculations
|
|
216
|
+
- `count` (number, optional) - Number of occurrences to return. Defaults to 1.
|
|
217
|
+
- `format` (string, optional) - Output format (json or text)
|
|
218
|
+
- `timezone` (string, optional) - Timezone for the results. Defaults to UTC.
|
|
219
|
+
|
|
220
|
+
## API Documentation
|
|
221
|
+
|
|
222
|
+
NOAA Tides and Currents API documentation can be found at:
|
|
223
|
+
- CO-OPS Data API: https://api.tidesandcurrents.noaa.gov/api/prod/
|
|
224
|
+
- CO-OPS Metadata API: https://api.tidesandcurrents.noaa.gov/mdapi/prod/
|
|
225
|
+
- CO-OPS Derived Product API: https://api.tidesandcurrents.noaa.gov/dpapi/prod/
|
|
226
|
+
|
|
227
|
+
## License
|
|
228
|
+
|
|
229
|
+
MIT
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<a href="https://glama.ai/mcp/servers/ro2rz2c734">
|
|
233
|
+
<img width="380" height="200" src="https://glama.ai/mcp/servers/ro2rz2c734/badge" />
|
|
234
|
+
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createServer, startServer } from './server/config.js';
|
|
3
|
+
import { registerAllTools } from './tools/index.js';
|
|
4
|
+
// Create and configure the MCP server
|
|
5
|
+
const server = createServer();
|
|
6
|
+
// Register all tools
|
|
7
|
+
const services = registerAllTools(server);
|
|
8
|
+
// Start the server
|
|
9
|
+
startServer(server);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MoonPhaseName } from '../types/moon.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for getting moon phase
|
|
5
|
+
*/
|
|
6
|
+
export declare const MoonPhaseParamsSchema: z.ZodObject<{
|
|
7
|
+
date: z.ZodOptional<z.ZodString>;
|
|
8
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
format: z.ZodOptional<z.ZodEnum<["json", "text"]>>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
date?: string | undefined;
|
|
13
|
+
format?: "text" | "json" | undefined;
|
|
14
|
+
latitude?: number | undefined;
|
|
15
|
+
longitude?: number | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
date?: string | undefined;
|
|
18
|
+
format?: "text" | "json" | undefined;
|
|
19
|
+
latitude?: number | undefined;
|
|
20
|
+
longitude?: number | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type MoonPhaseParams = z.infer<typeof MoonPhaseParamsSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Parameters for getting moon phases for a date range
|
|
25
|
+
*/
|
|
26
|
+
export declare const MoonPhasesRangeParamsSchema: z.ZodObject<{
|
|
27
|
+
start_date: z.ZodString;
|
|
28
|
+
end_date: z.ZodString;
|
|
29
|
+
latitude: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
longitude: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
format: z.ZodOptional<z.ZodEnum<["json", "text"]>>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
start_date: string;
|
|
34
|
+
end_date: string;
|
|
35
|
+
format?: "text" | "json" | undefined;
|
|
36
|
+
latitude?: number | undefined;
|
|
37
|
+
longitude?: number | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
start_date: string;
|
|
40
|
+
end_date: string;
|
|
41
|
+
format?: "text" | "json" | undefined;
|
|
42
|
+
latitude?: number | undefined;
|
|
43
|
+
longitude?: number | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export type MoonPhasesRangeParams = z.infer<typeof MoonPhasesRangeParamsSchema>;
|
|
46
|
+
/**
|
|
47
|
+
* Parameters for getting next moon phase
|
|
48
|
+
*/
|
|
49
|
+
export declare const NextMoonPhaseParamsSchema: z.ZodObject<{
|
|
50
|
+
phase: z.ZodEnum<[MoonPhaseName.NEW_MOON, MoonPhaseName.FIRST_QUARTER, MoonPhaseName.FULL_MOON, MoonPhaseName.LAST_QUARTER]>;
|
|
51
|
+
date: z.ZodOptional<z.ZodString>;
|
|
52
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
format: z.ZodOptional<z.ZodEnum<["json", "text"]>>;
|
|
54
|
+
}, "strip", z.ZodTypeAny, {
|
|
55
|
+
phase: MoonPhaseName.NEW_MOON | MoonPhaseName.FIRST_QUARTER | MoonPhaseName.FULL_MOON | MoonPhaseName.LAST_QUARTER;
|
|
56
|
+
date?: string | undefined;
|
|
57
|
+
format?: "text" | "json" | undefined;
|
|
58
|
+
count?: number | undefined;
|
|
59
|
+
}, {
|
|
60
|
+
phase: MoonPhaseName.NEW_MOON | MoonPhaseName.FIRST_QUARTER | MoonPhaseName.FULL_MOON | MoonPhaseName.LAST_QUARTER;
|
|
61
|
+
date?: string | undefined;
|
|
62
|
+
format?: "text" | "json" | undefined;
|
|
63
|
+
count?: number | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
export type NextMoonPhaseParams = z.infer<typeof NextMoonPhaseParamsSchema>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { MoonPhaseName } from '../types/moon.js';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for getting moon phase
|
|
5
|
+
*/
|
|
6
|
+
export const MoonPhaseParamsSchema = z.object({
|
|
7
|
+
date: z.string().optional().describe('Date to get moon phase for (YYYY-MM-DD format). Defaults to current date.'),
|
|
8
|
+
latitude: z.number().min(-90).max(90).optional().describe('Latitude for location-specific calculations'),
|
|
9
|
+
longitude: z.number().min(-180).max(180).optional().describe('Longitude for location-specific calculations'),
|
|
10
|
+
format: z.enum(['json', 'text']).optional().describe('Output format (json or text)')
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Parameters for getting moon phases for a date range
|
|
14
|
+
*/
|
|
15
|
+
export const MoonPhasesRangeParamsSchema = z.object({
|
|
16
|
+
start_date: z.string().describe('Start date (YYYY-MM-DD format)'),
|
|
17
|
+
end_date: z.string().describe('End date (YYYY-MM-DD format)'),
|
|
18
|
+
latitude: z.number().min(-90).max(90).optional().describe('Latitude for location-specific calculations'),
|
|
19
|
+
longitude: z.number().min(-180).max(180).optional().describe('Longitude for location-specific calculations'),
|
|
20
|
+
format: z.enum(['json', 'text']).optional().describe('Output format (json or text)')
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Parameters for getting next moon phase
|
|
24
|
+
*/
|
|
25
|
+
export const NextMoonPhaseParamsSchema = z.object({
|
|
26
|
+
phase: z.enum([
|
|
27
|
+
MoonPhaseName.NEW_MOON,
|
|
28
|
+
MoonPhaseName.FIRST_QUARTER,
|
|
29
|
+
MoonPhaseName.FULL_MOON,
|
|
30
|
+
MoonPhaseName.LAST_QUARTER
|
|
31
|
+
]).describe('Moon phase to find'),
|
|
32
|
+
date: z.string().optional().describe('Starting date (YYYY-MM-DD format). Defaults to current date.'),
|
|
33
|
+
count: z.number().positive().optional().describe('Number of occurrences to return. Defaults to 1.'),
|
|
34
|
+
format: z.enum(['json', 'text']).optional().describe('Output format (json or text)')
|
|
35
|
+
});
|