
composio antispace
一个集成了MCP服务器、自动生成TypeScript函数定义、支持Slack操作的项目。
Repository Info
About This Server
一个集成了MCP服务器、自动生成TypeScript函数定义、支持Slack操作的项目。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Composio + Antispace Integration
🚀 Features
- 🔗 MCP Server Integration: Connect to any MCP streamable HTTP server
- 📝 Auto-Generated Functions: Automatically generate TypeScript function definitions
- 🤖 AI Actions: Generate AI action handlers for Antispace
- ⚡ Slack Integration: Pre-built Slack functions for common operations
- 🔧 Type Safety: Full TypeScript support with proper type inference
- 🎯 Schema Processing: Intelligent handling of complex JSON schemas including
anyOf
📋 Prerequisites
- Node.js 18+
- pnpm or npm
- TypeScript knowledge
- Access to an MCP server (for custom integrations)
🛠️ Installation
# Clone the repository
git clone <repository-url>
cd composio-slack-antispace
# Install dependencies
pnpm install
# Build the project
anti build
# Dev
anti dev
# Deploy
anti deploy
🎯 Quick Start
1. Goto mcp.composio.dev and crearte an MCP server
Simply goto mcp.composio.dev and generate a mcp server with the actions you want. After that just copy the url for the below steps
2. Generate Functions from MCP Server
Use the built-in CLI to connect to an MCP server and generate function definitions:
# Or use a remote MCP server
pnpm generate-functions https://mcp.composio.dev/composio/server/eae16540-5a55-445a-b386-5b51550b9825/mcp
This command will:
- Connect to the MCP server
- Retrieve all available tools
- Generate TypeScript function definitions in
src/manifest/functions.ts - Create AI action handlers in
src/ai/actions/index.ts - Update the AI router in
src/ai/index.ts
3. Available Slack Functions
The project comes with pre-built Slack functions:
Message Operations
SLACK_SENDS_A_MESSAGE_TO_A_SLACK_CHANNEL- Send messages to channelsSLACK_UPDATES_A_SLACK_MESSAGE- Update existing messagesSLACK_FETCH_CONVERSATION_HISTORY- Get message history
Reactions
SLACK_ADD_REACTION_TO_AN_ITEM- Add emoji reactionsSLACK_REMOVE_REACTION_FROM_ITEM- Remove emoji reactions
Search & Reminders
SLACK_SEARCH_FOR_MESSAGES_WITH_QUERY- Search messagesSLACK_CREATE_A_REMINDER- Create reminders
Connection Management
SLACK_CHECK_ACTIVE_CONNECTION- Check connection statusSLACK_INITIATE_CONNECTION- Create new connectionsSLACK_GET_REQUIRED_PARAMETERS- Get connection requirements
🔧 MCP Generator CLI
Usage
tsx scripts/generate-action.ts <mcp-server-url>
What it generates:
1. Manifest Functions (src/manifest/functions.ts)
export const TOOL_NAME: AntispaceAppFunction<
"TOOL_NAME",
{
param1: string
param2?: number
}
> = {
type: "function",
function: {
name: "TOOL_NAME",
description: "Tool description",
parameters: { /* JSON schema */ },
},
}
2. AI Actions (src/ai/actions/index.ts)
export const TOOL_NAME = async (param1: string, param2?: number) => {
try {
const result = await callMCPTool("TOOL_NAME", { param1, param2 });
return result;
} catch (error) {
console.error("Error calling TOOL_NAME:", error);
throw error;
}
}
3. AI Router (src/ai/index.ts)
case "TOOL_NAME": {
const { param1, param2 } = _parameters;
try {
const result = await actions.TOOL_NAME(param1, param2);
return { success: true, result };
} catch (error: any) {
return { error: error.message || error.toString() };
}
}
🏗️ Project Structure
src/
├── manifest/
│ └── functions.ts # Generated function definitions
├── ai/
│ ├── index.ts # AI router with switch cases
│ └── actions/
│ └── index.ts # MCP client and action functions
└── ...
scripts/
└── generate-action.ts # MCP generator CLI
package.json # Dependencies and scripts
README.md # This file
🔄 ANTI SDK limitations
The generator intelligently processes JSON schemas:
anyOf Handling - doesn't work with anti SDK
Automatically selects the first non-null object from anyOf arrays:
// Input schema
{
"anyOf": [
{
"type": "object",
"properties": { "name": { "type": "string" } }
},
{
"enum": ["null"],
"nullable": true
}
]
}
// Processed schema
{
"type": "object",
"properties": { "name": { "type": "string" } }
}
Type Mapping
integer→number
Parameter Ordering
Ensures TypeScript compatibility by ordering parameters:
- Required parameters first
- Optional parameters second
- Maintains proper typing
🚀 Development
Running in Development
anti dev
Quick Start
Clone the repository
git clone https://github.com/utkarsh-dixit/composio-antispaceInstall dependencies
cd composio-antispace
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.