Speckle MCP Server
by bimgeek
Verified
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/mucahitbilalgoker/Documents/Cline/MCP/speckle-mcp/.venv/lib/python3.13/site-packages/stringcase.py:247: SyntaxWarning: invalid escape sequence '\\W'\n",
" return re.sub(\"\\W+\", \"\", string)\n"
]
}
],
"source": [
"from typing import Any, List, Dict, Optional\n",
"import asyncio\n",
"from mcp.server.fastmcp import FastMCP\n",
"from specklepy.api.client import SpeckleClient\n",
"from specklepy.api.credentials import get_account_from_token"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"token = \"7e5ae9a129cbe5578a1a0ed7b81b6268216031e407\"\n",
"server_url = \"https://app.speckle.systems\""
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[Project(allow_public_comments=False, created_at=datetime.datetime(2025, 3, 7, 9, 19, 58, 584000, tzinfo=TzInfo(UTC)), description='', id='44e0aca06d', name='Timber Office', role='stream:owner', source_apps=['ETABS 22'], updated_at=datetime.datetime(2025, 3, 7, 9, 20, 21, 815000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2025, 3, 6, 10, 1, 42, 392000, tzinfo=TzInfo(UTC)), description='', id='9a21695f30', name='Hillside House', role='stream:owner', source_apps=['archicad'], updated_at=datetime.datetime(2025, 3, 6, 13, 45, 53, 359000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2025, 3, 5, 8, 38, 55, 489000, tzinfo=TzInfo(UTC)), description='', id='7b40acd8d8', name='Snowdon Tower', role='stream:owner', source_apps=['Revit 2025'], updated_at=datetime.datetime(2025, 3, 5, 8, 39, 45, 468000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2025, 3, 4, 12, 50, 34, 157000, tzinfo=TzInfo(UTC)), description='', id='5504d2849a', name='Acme Inc', role='stream:owner', source_apps=['Revit 2025'], updated_at=datetime.datetime(2025, 3, 4, 13, 39, 9, 542000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2025, 3, 4, 7, 51, 11, 704000, tzinfo=TzInfo(UTC)), description='', id='19d37ed754', name='Hero Images', role='stream:owner', source_apps=['Revit 2025'], updated_at=datetime.datetime(2025, 3, 4, 8, 3, 14, 83000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 1, 9, 7, 1, 14, 279000, tzinfo=TzInfo(UTC)), description='', id='26e4c4aab5', name='Community Reports', role='stream:owner', source_apps=['Grasshopper7', 'revit', 'Revit2024', 'sketchup', 'Revit2022', 'rhino', 'teklastructures', 'Revit2023', 'AutoCAD2024', 'Rhino7', 'DynamoRevit2023'], updated_at=datetime.datetime(2025, 2, 20, 15, 3, 11, 922000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2025, 2, 18, 10, 40, 20, 479000, tzinfo=TzInfo(UTC)), description='', id='1ca4992bf5', name='Tutorials', role='stream:owner', source_apps=['revit'], updated_at=datetime.datetime(2025, 2, 18, 10, 42, 27, 386000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 11, 14, 16, 26, 36, 727000, tzinfo=TzInfo(UTC)), description='', id='2629e222e3', name='carlos', role='stream:owner', source_apps=[], updated_at=datetime.datetime(2025, 1, 30, 21, 35, 29, 543000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id='9b20d1cd0a'),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 11, 14, 16, 27, 30, 690000, tzinfo=TzInfo(UTC)), description='powerbi test', id='6caedbc3df', name='carmine test', role='stream:owner', source_apps=['Revit2024'], updated_at=datetime.datetime(2025, 1, 30, 21, 35, 18, 19000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id='9b20d1cd0a'),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 10, 28, 9, 42, 46, 731000, tzinfo=TzInfo(UTC)), description='', id='98e809d8c4', name='BI Dashboards Workshop', role='stream:owner', source_apps=['revit', 'Revit2024'], updated_at=datetime.datetime(2025, 1, 13, 16, 6, 25, 133000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id='9b20d1cd0a'),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 10, 8, 10, 41, 37, 393000, tzinfo=TzInfo(UTC)), description='', id='d6c40755b1', name=\"Bilal's Braindump\", role='stream:owner', source_apps=['rhino', 'blender', 'IFC'], updated_at=datetime.datetime(2025, 1, 13, 15, 59, 43, 826000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2023, 9, 20, 6, 9, 48, 967000, tzinfo=TzInfo(UTC)), description='', id='951b4e7759', name='Power BI Investigations', role='stream:owner', source_apps=['rhino', 'python', 'Revit2022'], updated_at=datetime.datetime(2025, 1, 6, 11, 49, 39, 680000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 12, 19, 9, 18, 15, 750000, tzinfo=TzInfo(UTC)), description='', id='ff571b905f', name='Client Support', role='stream:owner', source_apps=['revit'], updated_at=datetime.datetime(2024, 12, 19, 9, 18, 51, 771000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 12, 13, 8, 41, 44, 85000, tzinfo=TzInfo(UTC)), description='', id='c7775d304f', name='[CONFIDENTIAL] 10961-double precision issue', role='stream:owner', source_apps=[], updated_at=datetime.datetime(2024, 12, 15, 3, 41, 11, 592000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.PRIVATE: 'PRIVATE'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 12, 13, 9, 30, 38, 36000, tzinfo=TzInfo(UTC)), description='', id='fdbfa4414f', name='WRITE - TESTING MODEL CARDS', role='stream:contributor', source_apps=['rhino'], updated_at=datetime.datetime(2024, 12, 13, 9, 47, 32, 473000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 12, 13, 9, 30, 45, 29000, tzinfo=TzInfo(UTC)), description='', id='7ab16094bf', name='READ - TESTING MODEL CARDS', role='stream:reviewer', source_apps=['rhino'], updated_at=datetime.datetime(2024, 12, 13, 9, 39, 34, 137000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 12, 10, 13, 34, 7, 387000, tzinfo=TzInfo(UTC)), description='', id='269ac29687', name='Paige Tien Demo', role='stream:owner', source_apps=['Grasshopper7'], updated_at=datetime.datetime(2024, 12, 10, 13, 36, 37, 586000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 11, 7, 16, 22, 5, 282000, tzinfo=TzInfo(UTC)), description='', id='51f897da5f', name='Spockle Center', role='stream:owner', source_apps=['rhino'], updated_at=datetime.datetime(2024, 11, 18, 18, 32, 17, 815000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id='9b20d1cd0a'),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2022, 8, 27, 19, 10, 36, 350000, tzinfo=TzInfo(UTC)), description='', id='b573f65f0b', name='CADtoRevit', role='stream:contributor', source_apps=['Revit2024', 'AutoCAD2022', 'AutoCAD2021'], updated_at=datetime.datetime(2024, 10, 20, 18, 20, 44, 823000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.PRIVATE: 'PRIVATE'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 9, 26, 13, 12, 12, 278000, tzinfo=TzInfo(UTC)), description='', id='9e51e3dade', name='New Website', role='stream:owner', source_apps=['rhino', 'Navisworks 2023', 'Rhino7', 'sketchup'], updated_at=datetime.datetime(2024, 10, 11, 13, 56, 45, 514000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 10, 9, 8, 26, 26, 360000, tzinfo=TzInfo(UTC)), description='', id='dcadb811c4', name='_WebModel', role='stream:contributor', source_apps=['Rhino7'], updated_at=datetime.datetime(2024, 10, 9, 16, 20, 45, 676000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.PRIVATE: 'PRIVATE'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2024, 9, 4, 13, 2, 37, 243000, tzinfo=TzInfo(UTC)), description='', id='56d9a258d5', name='Speckle Hospital', role='stream:owner', source_apps=['revit'], updated_at=datetime.datetime(2024, 9, 4, 13, 56, 37, 292000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2023, 10, 17, 10, 37, 51, 837000, tzinfo=TzInfo(UTC)), description='', id='658f2468f5', name='Bank of Italy', role='stream:owner', source_apps=['blender', 'Revit2022'], updated_at=datetime.datetime(2024, 8, 5, 13, 57, 20, 28000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.PRIVATE: 'PRIVATE'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2023, 9, 22, 11, 40, 11, 806000, tzinfo=TzInfo(UTC)), description='', id='4f17b3b4da', name='Revit Tests', role='stream:owner', source_apps=['Revit2022', 'Revit2023', 'blender', 'excel'], updated_at=datetime.datetime(2024, 8, 1, 12, 36, 0, 327000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.UNLISTEd: 'UNLISTED'>, workspace_id=None),\n",
" Project(allow_public_comments=False, created_at=datetime.datetime(2023, 10, 12, 7, 17, 28, 423000, tzinfo=TzInfo(UTC)), description='', id='5068348197', name='Basic Sample Project', role='stream:owner', source_apps=['blender', 'Revit2022'], updated_at=datetime.datetime(2024, 8, 1, 12, 35, 47, 168000, tzinfo=TzInfo(UTC)), visibility=<ProjectVisibility.PRIVATE: 'PRIVATE'>, workspace_id=None)]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Initialize the Speckle client with the token\n",
"client = SpeckleClient(host=server_url)\n",
"client.authenticate_with_token(token)\n",
"user = client.active_user.get()\n",
"projects = client.active_user.get_projects()\n",
"projects.items"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}