Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

feat(docs): add MCP class to SDK reference documentation

Sushmithamalleshb521f890fbfd
diff --git a/.github/workflows/generate-sdk-docs.yml b/.github/workflows/generate-sdk-docs.yml
index cb45209bb..4ab3673e5 100644
--- a/.github/workflows/generate-sdk-docs.yml
+++ b/.github/workflows/generate-sdk-docs.yml
@@ -24,9 +24,7 @@ jobs:
- run: pnpm install --frozen-lockfile
- - name: Generate TypeScript SDK docs
- working-directory: docs
- run: bun run generate:sdk-reference:ts
+ - run: pnpm --filter @composio/core generate:docs
- name: Create Pull Request
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
@@ -51,9 +49,7 @@ jobs:
- name: Setup Python with UV
uses: ./.github/actions/setup-python-uv
- - name: Generate Python SDK docs
- working-directory: docs
- run: uv run --with griffe python scripts/sdk-reference/generate-python.py
+ - run: cd python && uv run --with griffe python scripts/generate-docs.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
diff --git a/docs/CLAUDE.md b/docs/CLAUDE.md
index 8f2d34197..d3465fce2 100644
--- a/docs/CLAUDE.md
+++ b/docs/CLAUDE.md
@@ -21,18 +21,15 @@ Auto-generated SDK documentation from source code.
### TypeScript SDK
- **Source**: `ts/packages/core/src/models/*.ts` (JSDoc comments)
-- **Generator**: `scripts/sdk-reference/generate-typescript.ts`
+- **Generator**: `ts/packages/core/scripts/generate-docs.ts`
- **Output**: `content/reference/sdk-reference/typescript/`
-- **Regenerate**: `bun run generate:sdk-reference:ts`
+- **Regenerate**: `pnpm --filter @composio/core generate:docs`
### Python SDK
- **Source**: `python/composio/**/*.py` (docstrings)
-- **Generator**: `scripts/sdk-reference/generate-python.py` (uses griffe)
+- **Generator**: `python/scripts/generate-docs.py` (uses griffe)
- **Output**: `content/reference/sdk-reference/python/`
-- **Regenerate**: `bun run generate:sdk-reference:py`
-
-### Both SDKs
-- **Regenerate all**: `bun run generate:sdk-reference`
+- **Regenerate**: `cd python && uv run --with griffe python scripts/generate-docs.py`
CI auto-generates on changes to `ts/packages/core/src/**` or `python/composio/**` via `.github/workflows/generate-sdk-docs.yml`.
diff --git a/docs/package.json b/docs/package.json
index 86780066f..aecec9f9d 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -10,10 +10,7 @@
"postinstall": "fumadocs-mdx",
"lint": "eslint",
"lint:links": "bun scripts/validate-links.ts",
- "generate:toolkits": "bun scripts/generate-toolkits.ts",
- "generate:sdk-reference:ts": "bun scripts/sdk-reference/generate-typescript.ts",
- "generate:sdk-reference:py": "uv run --with griffe python scripts/sdk-reference/generate-python.py",
- "generate:sdk-reference": "bun run generate:sdk-reference:ts && bun run generate:sdk-reference:py"
+ "generate:toolkits": "bun scripts/generate-toolkits.ts"
},
"dependencies": {
"@radix-ui/react-tabs": "^1.1.13",
@@ -33,7 +30,6 @@
"tailwind-merge": "^3.4.0"
},
"devDependencies": {
- "typedoc": "^0.28.5",
"@ai-sdk/anthropic": "^3.0.11",
"@ai-sdk/mcp": "^1.0.6",
"@ai-sdk/openai": "^3.0.9",
diff --git a/python/scripts/README.md b/python/scripts/README.md
new file mode 100644
index 000000000..bc2e665c4
--- /dev/null
+++ b/python/scripts/README.md
@@ -0,0 +1,26 @@
+# SDK Documentation Generator
+
+Generates MDX reference docs from Python source using griffe.
+
+## Usage
+
+```bash
+cd python
+uv run --with griffe python scripts/generate-docs.py
+```
+
+## How it works
+
+1. griffe extracts docstrings from `composio/**/*.py` → structured data
+2. `generate-docs.py` transforms data → MDX files
+3. Output written to `docs/content/reference/sdk-reference/python/`
+
+## Configuration
+
+- **Expected classes**: `EXPECTED_CLASSES` dict maps class name → Composio property
+- **Modules to search**: `CLASS_MODULES` list
+- **Decorators**: `DECORATORS_TO_DOCUMENT` list
+
+## CI
+
+`.github/workflows/generate-sdk-docs.yml` triggers on changes to `python/composio/**` and opens a PR with updated docs.
diff --git a/docs/scripts/sdk-reference/generate-python.py b/python/scripts/generate-docs.py
similarity index 97%
rename from docs/scripts/sdk-reference/generate-python.py
rename to python/scripts/generate-docs.py
index cdf4776c3..43f82bdd4 100644
--- a/docs/scripts/sdk-reference/generate-python.py
+++ b/python/scripts/generate-docs.py
@@ -5,7 +5,7 @@ Python SDK Documentation Generator
Generates MDX documentation from Python source code using griffe.
Output is written to the docs content directory.
-Run from docs/: uv run --with griffe python scripts/sdk-reference/generate-python.py
+Run: cd python && uv run --with griffe python scripts/generate-docs.py
"""
from __future__ import annotations
@@ -22,11 +22,17 @@ except ImportError:
print("Error: griffe not installed. Run: pip install griffe")
raise SystemExit(1)
-# Paths (relative to docs/scripts/sdk-reference/)
+# Paths
SCRIPT_DIR = Path(__file__).parent
-DOCS_DIR = SCRIPT_DIR.parent.parent
-PY_SDK_DIR = DOCS_DIR.parent / "python"
-OUTPUT_DIR = DOCS_DIR / "content" / "reference" / "sdk-reference" / "python"
+PACKAGE_DIR = SCRIPT_DIR.parent
+OUTPUT_DIR = (
+ PACKAGE_DIR.parent
+ / "docs"
+ / "content"
+ / "reference"
+ / "sdk-reference"
+ / "python"
+)
# GitHub base URL for source links
GITHUB_BASE = "https://github.com/composiohq/composio/blob/next/python"
@@ -88,7 +94,7 @@ def get_source_link(obj: griffe.Object) -> str | None:
resolved_path = raw_filepath
if not resolved_path:
return None
- rel_path = resolved_path.relative_to(PY_SDK_DIR)
+ rel_path = resolved_path.relative_to(PACKAGE_DIR)
except ValueError:
return None
line = obj.lineno if hasattr(obj, "lineno") and obj.lineno else 1
@@ -455,7 +461,7 @@ def main():
# Load package
print("Loading composio package...")
try:
- package = griffe.load("composio", search_paths=[str(PY_SDK_DIR)])
+ package = griffe.load("composio", search_paths=[str(PACKAGE_DIR)])
except Exception as e:
print(f"Error: {e}")
raise SystemExit(1)
diff --git a/ts/packages/core/package.json b/ts/packages/core/package.json
index 6f184209c..d9e4ec8b5 100644
--- a/ts/packages/core/package.json
+++ b/ts/packages/core/package.json
@@ -119,7 +119,8 @@
"clean": "git clean -xdf node_modules",
"build": "bun run --bun tsdown",
"test": "vitest run",
- "typecheck": "tsc --noEmit --skipLibCheck && tsc --noEmit --skipLibCheck -p tsconfig.type-tests.json"
+ "typecheck": "tsc --noEmit --skipLibCheck && tsc --noEmit --skipLibCheck -p tsconfig.type-tests.json",
+ "generate:docs": "tsx scripts/generate-docs.ts"
},
"keywords": [],
"author": "",
diff --git a/ts/packages/core/scripts/README.md b/ts/packages/core/scripts/README.md
new file mode 100644
index 000000000..b42e4325e
--- /dev/null
+++ b/ts/packages/core/scripts/README.md
@@ -0,0 +1,25 @@
+# SDK Documentation Generator
+
+Generates MDX reference docs from TypeScript source using TypeDoc.
+
+## Usage
+
+```bash
+pnpm generate:docs
+```
+
+## How it works
+
+1. TypeDoc extracts JSDoc from `src/models/*.ts` → JSON AST
+2. `generate-docs.ts` transforms AST → MDX files
+3. Output written to `docs/content/reference/sdk-reference/typescript/`
+
+## Configuration
+
+- **Entry points**: Auto-discovered from `src/models/*.ts`
+- **Excluded classes**: `INTERNAL_CLASSES` set in script
+- **User-instantiated classes**: `USER_INSTANTIATED_CLASSES` (shows constructor)
+
+## CI
+
+`.github/workflows/generate-sdk-docs.yml` triggers on changes to `ts/packages/core/src/**` and opens a PR with updated docs.
diff --git a/docs/scripts/sdk-reference/generate-typescript.ts b/ts/packages/core/scripts/generate-docs.ts
similarity index 97%
rename from docs/scripts/sdk-reference/generate-typescript.ts
rename to ts/packages/core/scripts/generate-docs.ts
index ea6477ad3..92ef8bb1a 100644
--- a/docs/scripts/sdk-reference/generate-typescript.ts
+++ b/ts/packages/core/scripts/generate-docs.ts
@@ -4,7 +4,7 @@
* Generates MDX documentation from TypeScript source code using TypeDoc.
* Output is written to the docs content directory.
*
- * Run from docs/: bun scripts/sdk-reference/generate-typescript.ts
+ * Run: pnpm --filter @composio/core generate:docs
*/
import { mkdir, writeFile, rm, readdir, readFile } from 'fs/promises';
@@ -12,13 +12,15 @@ import { join, dirname } from 'path';
import { execSync } from 'child_process';
import { fileURLToPath } from 'url';
-// Paths (relative to docs/scripts/sdk-reference/)
+// Paths (relative to ts/packages/core)
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
-const DOCS_DIR = join(SCRIPT_DIR, '../..');
-const TS_SDK_DIR = join(DOCS_DIR, '../ts/packages/core');
-const MODELS_DIR = join(TS_SDK_DIR, 'src/models');
-const OUTPUT_DIR = join(DOCS_DIR, 'content/reference/sdk-reference/typescript');
-const TEMP_JSON = join(TS_SDK_DIR, '.typedoc-output.json');
+const PACKAGE_DIR = join(SCRIPT_DIR, '..');
+const MODELS_DIR = join(PACKAGE_DIR, 'src/models');
+const OUTPUT_DIR = join(
+ PACKAGE_DIR,
+ '../../../docs/content/reference/sdk-reference/typescript'
+);
+const TEMP_JSON = join(PACKAGE_DIR, '.typedoc-output.json');
// Internal classes that should NOT be documented (accessed via other APIs)
const INTERNAL_CLASSES = new Set([
@@ -723,7 +725,7 @@ async function runTypeDoc(): Promise<TypeDocProject> {
].join(' ');
try {
- execSync(cmd, { stdio: 'pipe', cwd: TS_SDK_DIR });
+ execSync(cmd, { stdio: 'pipe', cwd: PACKAGE_DIR });
} catch (error) {
console.error('TypeDoc failed:', error);
throw error;
@@ -735,7 +737,7 @@ async function runTypeDoc(): Promise<TypeDocProject> {
async function main() {
console.log('Starting TypeScript SDK documentation generation...\n');
- console.log(`Package dir: ${TS_SDK_DIR}`);
+ console.log(`Package dir: ${PACKAGE_DIR}`);
console.log(`Output dir: ${OUTPUT_DIR}\n`);
// Clean output directory