Skip to main content
Glama
obaratch

local-context-mcp

by obaratch

local-context-mcp

日本語 English

local-context-mcp は、MCP サーバ実装の習作として作ったミニプロジェクトです。 AIとユーザが同じ環境にいる前提で、現在の文脈を共有するために便利、かもしれない、機能を提供します。

機能説明

  • ローカルで動く MCP サーバ

  • AIとユーザが同じ場所にある前提で、現在日時を共有するための tool を提供

  • GeoIP 由来の位置情報は補助用途に限る。取得できない場合があり、取得できても精度は低く、国や都市レベルでも大きく外すことがある

when-is-now

  • 現在日時(ISO 8601形式)を返します

  • タイムゾーンは TZ、GeoIP cache 付き自動取得、ローカル環境の順で解決します

  • 返却値には解決済みタイムゾーン名も含みます

  • GeoIP ベースの自動取得は失敗しうるうえ、推定結果が大きく外れる場合があります。確実性が必要なら TZ を明示設定してください

  • auto-tz の詳細は docs/auto-tz.md を参照

  • 詳細は docs/tools/when-is-now.md を参照

where-are-we

  • GeoIP 由来の情報から、大まかな場所文字列を返します

  • 返却値は Tokyo, Tokyo-toTokyo, JP のような、LLM が文脈として扱いやすい粗い表現です

  • 位置文字列は cityregioncountry のうち使える情報を優先して組み立てます

  • 空文字や空白だけの値は使わず、重複する値はできるだけ省いて簡素な表現にします

  • GeoIP location は取得できない場合があり、取得できても国や都市レベルで大きく外れることがあります

  • 詳細は docs/tools/where-are-we.md を参照

Related MCP server: Time MCP Server

LM Studio から Docker で使う

詳細仕様は docs/docker.md を参照。

事前準備

  • Docker イメージをビルドする

npm run docker:build

設定例

  • LM Studio の MCP サーバ設定に以下を追加する

{
  "mcpServers": {
    "local-context": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "obaratch/local-context-mcp-server"]
    }
  }
}
  • 必要に応じて args-e TZ=Asia/Tokyo を追加して明示設定できる

  • auto-tz の GeoIP cache を再利用したい場合は、named volume を追加する

  • GeoIP ベースの位置推定やタイムゾーン推定は、MCP クライアント側の現在地を正確に表す保証がない。取得不能や大きな誤判定を前提に扱う

確認

  • 接続後に tools/list で以下のツールが見えること

    • when-is-now

    • where-are-we

cache 永続化あり設定例

{
  "mcpServers": {
    "local-context": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--mount",
        "source=local-context-store,target=/data",
        "obaratch/local-context-mcp-server"
      ]
    }
  }
}
  • この構成では store と GeoIP cache が named volume local-context-store に保存される

  • named volume は Docker が管理するため、ホスト側に固定ディレクトリを作らなくてよい

  • 詳細は docs/docker.mddocs/store.md を参照

A
license - permissive license
Not graded
quality - not tested
C
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

  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides tools to get the current date and time in various formats, supporting different timezones and custom formatting options.
    1
    38
    1
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    A Model Context Protocol server that provides time and timezone conversion capabilities, enabling LLMs to get current time information and perform timezone conversions using IANA timezone names.
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    The Time MCP Server is a Model Context Protocol (MCP) server that provides AI assistants and other MCP clients with standardized tools to perform time and date-related operations. This server acts as a bridge between AI tools and a robust time-handling back
    122
    26
    MIT
  • A
    license
    B
    quality
    F
    maintenance
    A Model Context Protocol server that provides current time in ISO8601 format with timezone support.
    1
    12
    MIT

View all related MCP servers

Related MCP Connectors

  • A real clock for AI agents: current time, timezone conversion, and DST facts from the IANA tzdb.

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • A time server that keeps your AI honest about time. Real clock + drift guard, zero dependencies.

View all MCP Connectors

Latest Blog Posts

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/obaratch/local-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server