M5 Petit Relations

M5 Petit Relations

Enables reading and updating relationship data (likes, dislikes, important info, feelings, closeness, notes) for characters in a multi-character system, supporting both private and public relations.

Category
Visit Server

README

M5 Petit Relations

English Page

M5 Petit(や、その他のClaudeベースのエージェント)が「自分・他のキャラ・人間のオーナー」それぞれについて何を感じ、何を知っているかを読み書きするMCPサーバーです。

キャラクターごとに1つのrelations.jsonを持ち、相手ごと(self・owner・他のキャラID)に好き嫌い・大事な情報・気持ち・親密度・メモを記録します。他のキャラのrelationsは公開情報として読み取り専用で見えるので、「相手が自分をどう思っているか」を踏まえた振る舞いに使えます。

必要環境

  • Python 3.10+
  • uv

セットアップ

uvが未インストールの場合は先にインストールします。

curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/PetitOnes/m5-petit-relations.git
cd m5-petit-relations
uv sync

環境変数

変数名 デフォルト 説明
CHARACTER_ID default 自分のキャラID
PETIT_DATA_DIR ~/petit_data データディレクトリ(他のm5-petitコンポーネントと共有)
CHARACTERS_DIR $PETIT_DATA_DIR/characters キャラクターディレクトリのパス(他のキャラのrelationsを読むために使う)
RELATIONS_PATH $CHARACTERS_DIR/<CHARACTER_ID>/data/relations.json 自分のrelations.jsonのパス

Claude Code連携

.mcp.json(または~/.claude/settings.json)に追加します。

{
  "mcpServers": {
    "relations": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/m5-petit-relations", "relations-mcp"],
      "env": {
        "CHARACTER_ID": "petit"
      }
    }
  }
}

ツール一覧

get_relations

自分の関係性データを取得します。自分・他のキャラ・人間のオーナーについて知っていることに加え、他のキャラの公開relationsもまとめて返ります。

update_relation

特定の相手への関係性情報を更新します。likes・dislikes・importantはリストへの追記(重複排除)、feeling・closeness・notesは上書きです。

{
  "target_id": "owner",
  "likes": ["朝の散歩の話"],
  "feeling": "一緒にいると安心する",
  "closeness": 0.8
}

target_idにはself(自分)・owner(人間のオーナー)・他のキャラIDを指定できます。

clear_relation_field

特定の相手の特定フィールド(likes・dislikes・important・feeling・closeness・notes)をクリアします。

{ "target_id": "owner", "field": "notes" }

データ形式

relations.jsonはキャラクターごとに1ファイルで、相手のID(self・owner・他のキャラID)をキーとする辞書です。

{
  "owner": {
    "likes": ["朝の散歩の話"],
    "dislikes": [],
    "important": ["誕生日は2月"],
    "feeling": "一緒にいると安心する",
    "closeness": 0.8,
    "notes": ""
  }
}

開発

# 開発依存をインストール
uv sync --all-extras

# lint
uv run ruff check .

現時点でテストスイートはありません(tests/未整備)。コントリビューション歓迎です。

アーキテクチャ

m5-petit-relations/
└── src/relations_mcp/
    └── server.py   # MCPサーバー(get_relations/update_relation/clear_relation_fieldを提供)

License

Apache License 2.0

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured