Skip to main content
Glama

IDS MCP サーバー

AIを活用した、IDS 1.0標準に100%準拠するbuildingSMART IDSファイルの作成

buildingSMART IDS 1.0標準に完全に準拠したInformation Delivery Specification(IDS)ファイルを、AIエージェントが決定論的に作成、検証、管理できるようにするMCP(Model Context Protocol)サーバーです。

ifc-ids-mcp MCP server

License: MIT Python 3.8+ Code style: black

特徴

  • ✅ IDS 1.0に100%準拠 - すべてのエクスポートは公式XSDスキーマに対して検証されます

  • ✅ IfcTester統合 - 公式のIfcOpenShellライブラリを使用

  • ✅ FastMCPコンテキストベースのセッション - 自動セッション管理

  • ✅ テスト駆動開発 - 包括的なテストにより95%以上のコードカバレッジを確保

  • ✅ 決定論的な出力 - 同じ入力からは常に同一の出力が生成されます

  • ✅ 型安全性 - Pydantic検証による完全な型ヒント

Related MCP server: ifc-mcp

クイックスタート

インストール

# Clone repository
git clone https://github.com/Quasar-Consulting-Group/ifc-ids-mcp.git
cd ifc-ids-mcp

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Claude Desktopでの使用

Claude Desktopの設定(claude_desktop_config.json)に追加します:

{
  "mcpServers": {
    "ids-mcp": {
      "command": "python",
      "args": ["-m", "ids_mcp_server"],
      "env": {
        "IDS_LOG_LEVEL": "INFO"
      }
    }
  }
}

プログラムによる使用

from ifctester import ids

# The MCP server handles this automatically via tools
# But you can also use IfcTester directly:

# Create new IDS
my_ids = ids.Ids(title="Project Requirements")

# Add specification
spec = ids.Specification(name="Wall Requirements", ifcVersion=["IFC4"])
spec.applicability.append(ids.Entity(name="IFCWALL"))

requirement = ids.Property(
    baseName="FireRating",
    propertySet="Pset_WallCommon",
    cardinality="required"
)
spec.requirements.append(requirement)

my_ids.specifications.append(spec)

# Export to XML
my_ids.to_xml("requirements.ids")

利用可能なMCPツール

ドキュメント管理

  • create_ids - 新しいIDSドキュメントを作成

  • load_ids - ファイルまたはXML文字列から既存のIDSを読み込み

  • export_ids - 検証付きでIDSをXMLにエクスポート

  • get_ids_info - ドキュメント構造とメタデータを取得

仕様管理

  • add_specification - IFCバージョンとカーディナリティを指定して仕様を追加

ファセット管理

基本ファセット

  • add_entity_facet - IFCエンティティタイプフィルターを追加(例:IFCWALL)

  • add_property_facet - プロパティ要件を追加

  • add_attribute_facet - IFC属性要件を追加

高度なファセット

  • add_classification_facet - 分類要件を追加

  • add_material_facet - 材料要件を追加

  • add_partof_facet - 空間関係要件を追加

制限管理

  • add_enumeration_restriction - 有効な値のリストに制限

  • add_pattern_restriction - 正規表現パターンで制限

  • add_bounds_restriction - 数値範囲で制限

  • add_length_restriction - 文字列の長さを制限

検証

  • validate_ids - XSDスキーマに対してIDSドキュメントを検証

  • validate_ifc_model - IDSに対してIFCモデルを検証(ボーナス機能)

事前検証と制約チェック

このMCPサーバーには、エクスポート時まで待つのではなく、ツールが呼び出された瞬間にIDS 1.0スキーマ違反を捕捉する事前検証が含まれています。これにより、AIエージェントに明確で実行可能なエラーメッセージを提供します。

IDS 1.0スキーマの制約

1. 適用範囲ごとに1つのエンティティファセット

制約: IDS 1.0では、仕様の適用範囲セクションごとにエンティティファセットは1つしか許可されません。

事前検証: add_entity_facetツールは、ファセットを追加する前にこの制約を検証します:

# ✅ CORRECT: First entity facet
add_entity_facet(spec_id="S1", location="applicability", entity_name="IFCWALL")

# ❌ INCORRECT: Second entity facet raises ToolError immediately
add_entity_facet(spec_id="S1", location="applicability", entity_name="IFCDOOR")
# Error: "IDS 1.0 XSD constraint violation: Only ONE entity facet is allowed..."

回避策: エンティティタイプごとに個別の仕様を作成してください:

# Specification 1: Walls
add_specification(name="Wall Requirements", ifc_versions=["IFC4"], identifier="S1")
add_entity_facet(spec_id="S1", location="applicability", entity_name="IFCWALL")

# Specification 2: Doors
add_specification(name="Door Requirements", ifc_versions=["IFC4"], identifier="S2")
add_entity_facet(spec_id="S2", location="applicability", entity_name="IFCDOOR")

2. プロパティファセットにはプロパティセットが必要

制約: IfcTesterは、有効なIDSエクスポートのためにproperty_setパラメータを必要とします。

事前検証: add_property_facetツールは、ファセットを追加する前にこの要件を検証します:

# ❌ INCORRECT: Missing property_set raises ToolError immediately
add_property_facet(
    spec_id="S1",
    location="requirements",
    property_name="FireRating"
)
# Error: "Property facet validation error: 'property_set' parameter is required..."

# ✅ CORRECT: Include property_set parameter
add_property_facet(
    spec_id="S1",
    location="requirements",
    property_name="FireRating",
    property_set="Pset_WallCommon"
)

一般的なプロパティセット:

  • Pset_WallCommon - 壁のプロパティ

  • Pset_DoorCommon - ドアのプロパティ

  • Pset_WindowCommon - 窓のプロパティ

  • Pset_SpaceCommon - スペースのプロパティ

  • Pset_Common - カスタム/汎用プロパティ

事前検証の利点

  1. 即時フィードバック - エクスポート時ではなく、ツール呼び出し時にエラーを捕捉

  2. 明確なエラーメッセージ - 回避策と例を含む

  3. 無効な状態の防止 - 作成中を通じてIDSドキュメントが有効に保たれる

  4. AIエージェントの体験向上 - エージェントが実行可能なガイダンスを受け取れる

IDS 1.0の制約に関する詳細なドキュメントはCLAUDE.mdを参照してください。

アーキテクチャ

┌─────────────────────────────────────────────┐
│           AI Agent (Claude, GPT)             │
└────────────────────┬────────────────────────┘
                     │ MCP Protocol
┌────────────────────▼────────────────────────┐
│            FastMCP Server                    │
│  ┌──────────────────────────────────────┐   │
│  │     MCP Tools (15+ tools)            │   │
│  └───────────────┬──────────────────────┘   │
│  ┌───────────────▼──────────────────────┐   │
│  │     Session Manager (Context)        │   │
│  └───────────────┬──────────────────────┘   │
│  ┌───────────────▼──────────────────────┐   │
│  │  IfcTester Integration (IDS Engine)  │   │
│  └──────────────────────────────────────┘   │
└─────────────────────────────────────────────┘
                     │
                     ▼
        IDS XML File (100% XSD compliant)

開発

テスト駆動開発

このプロジェクトは厳格にTDD手法に従います:

# Run all tests
pytest tests/ -v

# Run with coverage
pytest tests/ --cov=src/ids_mcp_server --cov-report=html

# Run specific test category
pytest tests/unit/ -v        # Unit tests
pytest tests/integration/ -v  # Integration tests
pytest tests/validation/ -v   # XSD validation tests

# Must maintain 95%+ coverage
pytest tests/ --cov-fail-under=95

TDDワークフロー (Red-Green-Refactor)

  1. RED - 失敗するテストを書く

  2. GREEN - パスするための最小限のコードを実装する

  3. REFACTOR - コードの品質を向上させる

例:

# RED: Write failing test
def test_create_specification():
    result = add_specification(name="Test", ifc_versions=["IFC4"])
    assert result["status"] == "success"

# GREEN: Implement
def add_specification(name, ifc_versions):
    return {"status": "success"}

# REFACTOR: Improve (keep tests passing)

コード品質

# Format code
black src/ tests/

# Lint code
ruff check src/ tests/

# Type checking (optional)
mypy src/

プロジェクト構造

ifc-ids-mcp/
├── src/
│   └── ids_mcp_server/
│       ├── __init__.py
│       ├── __main__.py
│       ├── server.py          # FastMCP server
│       ├── config.py          # Configuration
│       ├── version.py         # Version management
│       ├── session/           # Session management
│       │   ├── manager.py
│       │   ├── storage.py
│       │   ├── cleanup.py
│       │   └── models.py      # Session data models
│       └── tools/             # MCP tools (17 total)
│           ├── document.py
│           ├── specification.py
│           ├── facets.py
│           ├── restrictions.py    # Phase 007
│           ├── validation.py      # Phase 008
│           └── validators.py      # Early validation helpers
├── tests/                     # 168 tests, 94% coverage
│   ├── unit/                  # Unit tests
│   ├── component/             # Component tests
│   ├── integration/           # Integration tests
│   └── validation/            # XSD compliance tests
│       └── fixtures/          # Test fixtures
├── samples/                   # Sample IDS/IFC files
│   ├── wall_fire_rating.ids
│   └── walls-fire-rating.ifc
├── specs/                     # Implementation plans (PRDs)
├── .mcp.json                  # MCP server configuration
├── .coveragerc                # Coverage configuration
├── constitution.md            # Project principles
├── DESIGN_SPECIFICATION.md    # Technical specification
├── CLAUDE.md                  # AI agent guide
├── pyproject.toml
├── pytest.ini
└── README.md

憲法原則

このプロジェクトは、譲れない6つの原則に従います:

  1. 100% IDSスキーマ準拠 - すべてのエクスポートはXSDに対して検証される

  2. テスト駆動開発 - 95%以上のカバレッジ、コードより先にテストを書く

  3. IfcTester統合を最優先 - カスタムXML生成は行わない

  4. 決定論的な生成 - 同一の入力 = 同一の出力

  5. FastMCPコンテキストベースのセッション - 自動セッション管理

  6. Pythonのベストプラクティス - 型ヒント、PEP 8、モダンなPython

詳細はconstitution.mdを参照してください。

ドキュメント

依存関係

コア

  • fastmcp - MCPサーバーフレームワーク

  • ifctester - IDSオーサリングおよび検証(IfcOpenShellより)

  • pydantic - データ検証

開発

  • pytest - テストフレームワーク

  • pytest-asyncio - 非同期テストサポート

  • pytest-cov - カバレッジレポート

  • black - コードフォーマット

  • ruff - リンティング

参照

ライセンス

MITライセンス - 詳細はLICENSEファイルを参照してください

貢献

  1. プロジェクトの原則についてはconstitution.mdを読んでください

  2. TDD手法(Red-Green-Refactor)に従ってください

  3. 95%以上のテストカバレッジを確保してください

  4. すべてのエクスポートはIDS 1.0 XSDに対して検証される必要があります

  5. すべてのIDS操作にはIfcTesterを使用してください

サポート


ステータス: ✅ 実装完了 | 94% テストカバレッジ | 17 MCPツール | 168 テスト | 事前検証済み

IfcOpenShellとFastMCPを使用して❤️を込めて構築

Available Tools

17 tools
add_attribute_facetC

Add an attribute facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" attribute_name: Attribute name (e.g., "Name", "Description") ctx: FastMCP Context (auto-injected) value: Required value or pattern cardinality: "required", "optional", or "prohibited"

Returns: {"status": "added", "facet_type": "attribute", "spec_id": "S1"}

Inputs: spec_id (required), location (required), attribute_name (required), value, +1 more. Returns: object

add_bounds_restrictionB

Add numeric bounds restriction.

Args: spec_id: Specification identifier or name facet_index: Index of facet in location (0-based) parameter_name: Which parameter to restrict (e.g., "value") base_type: XSD base type (e.g., "xs:double", "xs:integer") ctx: FastMCP Context (auto-injected) location: "applicability" or "requirements" (default: "requirements") min_inclusive: Minimum value (inclusive) max_inclusive: Maximum value (inclusive) min_exclusive: Minimum value (exclusive) max_exclusive: Maximum value (exclusive)

Returns: {"status": "added", "restriction_type": "bounds", "spec_id": "S1"}

Example: Add bounds to property value: Height must be between 2.4 and 3.0 meters

Inputs: spec_id (required), facet_index (required), parameter_name (required), base_type (required), +5 more. Returns: object

add_classification_facetA

Add a classification facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" classification_value: Classification code or pattern ctx: FastMCP Context (auto-injected) classification_system: Classification system name or URI cardinality: "required", "optional", or "prohibited"

Returns: {"status": "added", "facet_type": "classification", "spec_id": "S1"}

Inputs: spec_id (required), location (required), classification_value (required), classification_system, +1 more. Returns: object

add_entity_facetA

Add an entity facet to a specification.

IMPORTANT: IDS 1.0 allows only ONE entity facet per applicability section. If you need multiple entity types, create separate specifications.

Args: spec_id: Specification identifier location: "applicability" or "requirements" entity_name: IFC entity name (e.g., "IFCWALL") ctx: FastMCP Context (auto-injected) predefined_type: Optional predefined type cardinality: "required", "optional", or "prohibited" (requirements only)

Returns: {"status": "added", "facet_type": "entity", "spec_id": "S1"}

Raises: ToolError: If trying to add second entity to applicability section

Inputs: spec_id (required), location (required), entity_name (required), predefined_type, +1 more. Returns: object

add_enumeration_restrictionA

Add enumeration restriction (list of allowed values).

Args: spec_id: Specification identifier or name facet_index: Index of facet in location (0-based) parameter_name: Which parameter to restrict (e.g., "value", "propertySet") base_type: XSD base type (e.g., "xs:string", "xs:integer") values: List of allowed values ctx: FastMCP Context (auto-injected) location: "applicability" or "requirements" (default: "requirements")

Returns: {"status": "added", "restriction_type": "enumeration", "spec_id": "S1"}

Example: Add enumeration to property value: FireRating must be "REI30", "REI60", or "REI90"

Inputs: spec_id (required), facet_index (required), parameter_name (required), base_type (required), +2 more. Returns: object

add_length_restrictionB

Add string length restriction.

Args: spec_id: Specification identifier or name facet_index: Index of facet in location (0-based) parameter_name: Which parameter to restrict (e.g., "value") base_type: XSD base type (e.g., "xs:string") ctx: FastMCP Context (auto-injected) location: "applicability" or "requirements" (default: "requirements") length: Exact length min_length: Minimum length max_length: Maximum length

Returns: {"status": "added", "restriction_type": "length", "spec_id": "S1"}

Example: Add length restriction to attribute value: Tag must be between 5 and 50 characters

Inputs: spec_id (required), facet_index (required), parameter_name (required), base_type (required), +4 more. Returns: object

add_material_facetB

Add a material facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" material_value: Material name, category, or URI ctx: FastMCP Context (auto-injected) cardinality: "required", "optional", or "prohibited"

Returns: {"status": "added", "facet_type": "material", "spec_id": "S1"}

Inputs: spec_id (required), location (required), material_value (required), cardinality. Returns: object

add_partof_facetC

Add a partOf facet to a specification.

Args: spec_id: Specification identifier location: "applicability" or "requirements" relation: Relationship type (e.g., "IFCRELCONTAINEDINSPATIALSTRUCTURE") parent_entity: Parent entity name (e.g., "IFCSPACE") ctx: FastMCP Context (auto-injected) parent_predefined_type: Optional predefined type for parent cardinality: "required", "optional", or "prohibited"

Returns: {"status": "added", "facet_type": "partof", "spec_id": "S1"}

Inputs: spec_id (required), location (required), relation (required), parent_entity (required), +2 more. Returns: object

add_pattern_restrictionA

Add pattern restriction (regex matching).

Args: spec_id: Specification identifier or name facet_index: Index of facet in location (0-based) parameter_name: Which parameter to restrict (e.g., "value") base_type: XSD base type (e.g., "xs:string") pattern: Regular expression pattern ctx: FastMCP Context (auto-injected) location: "applicability" or "requirements" (default: "requirements")

Returns: {"status": "added", "restriction_type": "pattern", "spec_id": "S1"}

Example: Add pattern to attribute value: Name must match "EW-[0-9]{3}"

Inputs: spec_id (required), facet_index (required), parameter_name (required), base_type (required), +2 more. Returns: object

add_property_facetA

Add a property facet to a specification.

IMPORTANT: The property_set parameter is REQUIRED for valid IDS export.

Args: spec_id: Specification identifier location: "applicability" or "requirements" property_name: Property name (e.g., "FireRating") ctx: FastMCP Context (auto-injected) property_set: Property set name (e.g., "Pset_WallCommon") - REQUIRED data_type: IFC data type (e.g., "IFCLABEL") value: Required value or pattern cardinality: "required", "optional", or "prohibited"

Returns: {"status": "added", "facet_type": "property", "spec_id": "S1"}

Raises: ToolError: If property_set is None or empty

Inputs: spec_id (required), location (required), property_name (required), property_set, +3 more. Returns: object

add_specificationB

Add a specification to the current session's IDS document.

Args: name: Specification name ifc_versions: List of IFC versions (e.g., ["IFC4", "IFC4X3"]) ctx: FastMCP Context (auto-injected) identifier: Optional unique identifier description: Why this information is required instructions: How to fulfill requirements min_occurs: Minimum occurrences (0 = optional) max_occurs: Maximum occurrences (int or "unbounded")

Returns: { "status": "added", "spec_id": "S1", "ifc_versions": ["IFC4"] }

Inputs: name (required), ifc_versions (required), identifier, description, +3 more. Returns: object

create_idsA

Create a new IDS document for this session.

Session is automatically tracked by FastMCP - no session_id parameter needed!

Args: title: Document title (required) ctx: FastMCP Context (auto-injected) author: Author email or name version: Version string date: Date in YYYY-MM-DD format description: Document description copyright: Copyright notice milestone: Project milestone purpose: Purpose of this IDS

Returns: { "status": "created", "session_id": "auto-generated-by-fastmcp", "title": "..." }

Inputs: title (required), author, version, date, +4 more. Returns: object

export_idsA

Export IDS document to XML file using IfcTester.

Uses current session automatically - no session_id parameter needed!

Args: ctx: FastMCP Context (auto-injected) output_path: File path (optional, returns XML string if not provided) validate: Whether to validate against XSD (default: True)

Returns: { "status": "exported", "xml": "...", # If no output_path "file_path": "...", # If output_path provided "validation": {"valid": true, "errors": []} }

Inputs: output_path, validate. Returns: object

get_ids_infoA

Get current session's IDS document structure.

Uses current session automatically - no session_id parameter needed!

Args: ctx: FastMCP Context (auto-injected)

Returns: { "title": "...", "author": "...", "specification_count": 3, "specifications": [...] }

Inputs: no named parameters. Returns: object

load_idsA

Load an existing IDS file into the current session.

Replaces any existing IDS in this session.

Args: source: File path or XML string ctx: FastMCP Context (auto-injected) source_type: "file" or "string"

Returns: { "status": "loaded", "title": "...", "specification_count": 3, "specifications": [...] }

Inputs: source (required), source_type. Returns: object

validate_idsA

Validate current session's IDS document.

Validates:

  1. Required fields present (title, specifications, etc.)

  2. Each specification has applicability

  3. IFC versions are valid

  4. XSD schema compliance (via IfcTester)

Args: ctx: FastMCP Context (auto-injected)

Returns: { "valid": true, "errors": [], "warnings": [], "specifications_count": 3, "details": { "has_title": true, "has_specifications": true, "xsd_valid": true } }

Inputs: no named parameters. Returns: object

validate_ifc_modelA

Validate an IFC model against the current session's IDS specifications.

This bonus feature leverages IfcTester's IFC validation capabilities.

Args: ifc_file_path: Path to IFC file ctx: FastMCP Context (auto-injected) report_format: "console", "json", or "html"

Returns (json format): { "status": "validation_complete", "total_specifications": 3, "passed_specifications": 2, "failed_specifications": 1, "report": { "specifications": [ { "name": "Wall Fire Rating", "status": "passed", "applicable_entities": 25, "passed_entities": 25, "failed_entities": 0 }, ... ] } }

Inputs: ifc_file_path (required), report_format. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 17 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap. The 'add_' tools create specific facet or restriction types (e.g., attribute, bounds, classification), while the management tools (create_ids, export_ids, etc.) handle document lifecycle operations. The descriptions clearly differentiate what each tool does, preventing agent confusion.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with snake_case throughout. The 'add_' prefix is used uniformly for facet/restriction creation tools, while management tools use clear verbs like create, export, get, load, and validate. This predictable naming makes the tool set easy to navigate and understand.

    Tool Count5/5

    With 17 tools, this server provides comprehensive coverage for IDS document creation and validation. The count is well-scoped for the domain, including core operations (create, export, validate), facet types (entity, property, material, etc.), and restriction types (bounds, enumeration, pattern). Each tool earns its place without redundancy.

    Completeness5/5

    The tool set provides complete coverage for IDS document lifecycle management. It includes document creation (create_ids), loading (load_ids), editing (add_* facets/restrictions), inspection (get_ids_info), validation (validate_ids), export (export_ids), and even model validation (validate_ifc_model). All essential CRUD operations are present with no apparent gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      Enables AI assistants to create, edit, and export IFC5/IFCX building information models through natural language, handling spatial structure, elements, geometry, metadata, validation, and export.
      73
      26
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI agents to load, query, and analyze IFC building model files, including spatial structures, elements, properties, materials, and geometry.
      20
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI assistants to inspect, create, and report on IFC/BIM files locally, and to open models in a viewer with BCF viewpoint support.
      5
      155 npm
      13
      Apache 2.0