| name | oceanographic-seawater-properties |
| description | Calculate seawater thermodynamic properties using TEOS-10 standard including density, salinity, sound speed, and freezing temperature for oceanography. |
| license | MIT license |
| metadata | {"skill-author":"PJLab"} |
| i18n | {"zh":{"description":"计算海水热力学性质。"}} |
Oceanographic Seawater Properties (TEOS-10)
Usage
1. MCP Server Definition
import asyncio
import json
from mcp.client.streamable_http import streamablehttp_client
from mcp import ClientSession
class OceanGSWClient:
"""Ocean GSW (Gibbs SeaWater) MCP Client"""
def __init__(self, server_url: str, api_key: str):
self.server_url = server_url
.api_key = api_key
.session =
():
()
:
.transport = streamablehttp_client(
url=.server_url,
headers={: .api_key}
)
.read, .write, .get_session_id = .transport.__aenter__()
.session_ctx = ClientSession(.read, .write)
.session = .session_ctx.__aenter__()
.session.initialize()
()
Exception e:
()
():
:
.session:
.session_ctx.__aexit__(, , )
(, ):
.transport.__aexit__(, , )
()
Exception e:
()
():
:
(result, ) result.content:
content = result.content[]
(content, ):
json.loads(content.text)
(result)
Exception e:
{: , : (result)}