Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

.ignore
.ignore

static/llms.txt
static/llmstxt
2 changes: 1 addition & 1 deletion docs/anyflow_cli/2_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sidebar_position: 2
- By default, your API key will be securely stored in your system's keychain.
- The storage method is automatically handled by the CLI to ensure maximum security.
- If keychain access is not available, the API key will be encrypted and stored in `~/.anyflow`.
- You can try to troubleshoot the keychain access issue [here](./4_keytar_troubleshoot.md).
<!-- - You can try to troubleshoot the keychain access issue [here](./4_keytar_troubleshoot.md). -->

3. **Verify Authentication**: After successful authentication, verify your login status by running:

Expand Down
Binary file added docs/img/mcp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/mcp_example_cursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions docs/mcp/1_install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
---

# AnyFlow MCP Installation

You are free to use the AnyFlow MCP without an API key. However, some features are only available with an API key.

To get your API key, log into the [AnyFlow Webapp](https://app.anyflow.pro/) and visit [API Keys](https://app.anyflow.pro/settings/api) section.

After installing AnyFlow MCP, you can deploy a project using this simple prompt:

```
Deploy this project using AnyFlow MCP
```

## How to Install AnyFlow MCP on Cursor IDE

### Step 1: Add AnyFlow MCP to Cursor IDE

Paste the following configuration into `Cursor Settings > MCP > Add new global MCP server`

```
{
"mcpServers": {
"anyflow": {
"command": "npx",
"args": [
"-y",
"supergateway",
"--sse",
"https://api.anyflow.pro/mcp/sse",
"--oauth2Bearer",
"YOUR_ANYFLOW_API_KEY"
]
},
}
}
```

### Step 2: Check if AnyFlow MCP is installed correctly

![AnyFlow MCP installed correctly](../img/mcp.png)

## How to Install AnyFlow MCP on Claude Desktop

Support for Claude Desktop is coming soon.

## How to use AnyFlow MCP in ChatGPT

Support for ChatGPT is coming soon.
44 changes: 44 additions & 0 deletions docs/mcp/2_features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
---

# AnyFlow MCP Features

## Core Capabilities

### Documentation and Guidance
- **Interactive Documentation**: Get natural language answers to your questions about AnyFlow
- **CLI Help**: Receive guidance and examples for command-line usage
- **Template Discovery**: Browse and learn about available smart contract templates

### Account Management
- **User Information**: Access your account details, plan, and usage limits
- **Project Management**: List and manage your deployed projects
- **Deployment History**: Track and review your contract deployments

### Smart Contract Deployment
- **Template-Based Deployment**: Deploy pre-built, audited smart contract templates
- **Local Project Deployment**: Deploy contracts directly from your machine
- **AI Workspace Deployment**: Deploy contracts from the AI agent's workspace
- **Multi-Chain Support**: Deploy to any supported EVM-compatible blockchain

## Available Tools

### Public Tools (No Authentication Required)

| Tool | Description |
|------|-------------|
| `anyflow_welcome` | Get started with AnyFlow's MCP interface |
| `anyflow_docs` | Interactive documentation and help |
| `anyflow_cli_help` | Command-line interface guidance |
| `anyflow_template_list` | Browse available contract templates |

### Authenticated Tools

| Tool | Description |
|------|-------------|
| `anyflow_get_user` | Retrieve account information and limits |
| `anyflow_projects_list` | List your deployed projects |
| `anyflow_project_info` | Get detailed project information |
| `anyflow_project_upload` | Upload a new project |
| `anyflow_deploy` | Deploy a contract from an uploaded project |
| `anyflow_template_deploy` | Deploy a template contract |
20 changes: 20 additions & 0 deletions docs/mcp/3_examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
---

# Integration Examples


## Deploying a Hardhat project using AnyFlow MCP on Cursor IDE

1. Install AnyFlow MCP on Cursor IDE (see [AnyFlow MCP Installation](./1_install.md))
2. Prompt to deploy:

![Cursor IDE MCP Deployment](../img/mcp_example_cursor.png)

## Deploying a Template Contract using Claude Desktop

Support for Claude Desktop is coming soon.

## Using ChatGPT to deploy an ERC20 token

Support for ChatGPT is coming soon.
14 changes: 14 additions & 0 deletions docs/mcp/4_orientations_for_ai.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
---

# Orientations for AI

This section is dedicated to AI agents using AnyFlow MCP.

- You (the client) can be running on a local machine or a remote server.
- When in a local machine, you can use the anyflow cli to deploy projects as you have access to the user's codebase.
- When in a remote server, you need to upload projects using the \`project_upload\` command.
- In both cases, you can deploy templates using the MCP server.
- Authentication is required for uploads and deployments.
- You can explore public resources without authentication.

24 changes: 24 additions & 0 deletions docs/mcp/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
sidebar_position: 4
---

# AnyFlow MCP

AnyFlow MCP is a [Model Context Protocol](https://docs.anthropic.com/en/docs/mcp) server that allows you to use AnyFlow's features in your favorite AI agents.

## Supported Agents

- [Cursor](./1_install.md#how-to-install-anyflow-mcp-on-cursor-ide)
- [Claude Desktop](./1_install.md#how-to-install-anyflow-mcp-on-claude-desktop)
- [ChatGPT](./1_install.md#how-to-use-anyflow-mcp-in-chatgpt)

## Supported Features

- Help you navigate AnyFlow documentation
- Get info about your account
- Manage projects
- Access your history of deployments
- Deploy Smart Contracts from templates
- Deploy Smart Contracts from the projects on your machine
- Deploy Smart Contracts from the AI's workspace
- Help you with your project on your machine
86 changes: 4 additions & 82 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import path from 'path';
import fs from 'fs';
import pluginLlmsTxt from './src/plugins/llms-txt-plugin'; // Import the new plugin

const config: Config = {
title: 'AnyFlow',
Expand All @@ -20,7 +19,7 @@ const config: Config = {
organizationName: 'AnyFlowLabs', // Usually your GitHub org/user name.
projectName: 'anyflow-docs', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
Expand All @@ -37,10 +36,7 @@ const config: Config = {
{
docs: {
sidebarPath: './sidebars.ts',
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
sidebarCollapsed: false,
},
blog: false,
gtag: {
Expand All @@ -54,81 +50,7 @@ const config: Config = {
],

plugins: [
// Plugin copied from https://github.com/prisma/docs
async function pluginLlmsTxt(context) {
return {
name: "llms-txt-plugin",
loadContent: async () => {
const { siteDir } = context;
const contentDir = path.join(siteDir, "docs");
const allMd: string[] = [];

// recursive function to get all md files
const getMdFiles = async (dir: string) => {
const entries = await fs.promises.readdir(dir, { withFileTypes: true });

for (const entry of entries) {
const fullPath = path.join(dir, entry.name);
if (entry.isDirectory()) {
await getMdFiles(fullPath);
} else if (entry.name.endsWith(".md")) {
const content = await fs.promises.readFile(fullPath, "utf8");
allMd.push(content);
}
}
};

await getMdFiles(contentDir);
return { allMd: allMd };
},
postBuild: async ({ content, routes, outDir }) => {
const { allMd } = content as { allMd: string[] };

// Write concatenated MD content
const concatenatedPath = path.join(outDir, "llms-full.txt");
await fs.promises.writeFile(concatenatedPath, allMd.join("\n\n---\n\n"));

// we need to dig down several layers:
// find PluginRouteConfig marked by plugin.name === "docusaurus-plugin-content-docs"
const docsPluginRouteConfig = routes.filter(
(route) => route.plugin.name === "docusaurus-plugin-content-docs"
)[0];

// docsPluginRouteConfig has a routes property has a record with the path "/" that contains all docs routes.
const allDocsRouteConfig = docsPluginRouteConfig.routes?.filter(
(route) => route.path === "/"
)[0];

let llmsTxt = '';

// A little type checking first
if (!allDocsRouteConfig?.props?.version) {
llmsTxt = ''
} else {
// this route config has a `props` property that contains the current documentation.
const currentVersionDocsRoutes = (
allDocsRouteConfig.props.version as Record<string, unknown>
).docs as Record<string, Record<string, unknown>>;

// for every single docs route we now parse a path (which is the key) and a title
const docsRecords = Object.entries(currentVersionDocsRoutes).map(([path, record]) => {
return `- [${record.title}](${path}): ${record.description}`;
});

// Build up llms.txt file
llmsTxt = `# ${context.siteConfig.title}\n\n## Docs\n\n${docsRecords.join("\n")}`;
}

// Write llms.txt file
const llmsTxtPath = path.join(outDir, "llms.txt");
try {
fs.writeFileSync(llmsTxtPath, llmsTxt);
} catch (err) {
throw err;
}
},
};
},
pluginLlmsTxt,
],

themeConfig: {
Expand Down
Loading