BisenseAI Logo
BisenseAI
Back to Use Cases

Creating an MCP App with BisenseAI

Developer ToolsDifficulty: IntermediateTime to Implement: 1–2 hours

Who This Guide Is For

Developers, agencies, and product teams building a MCP product on BisenseAI without maintaining separate UI and orchestration codebases. You want BisenseFlow for logic, Weaver for experience, and deploy as API/MCP with observability from day one.

Prerequisites

  • BisenseAI workspace with BisenseFlow and Weaver enabled
  • LLM provider API keys in BisenseAI secrets
  • Sample inputs representing real MCP scenarios for playground
  • Understanding of workflow I/O port binding to Weaver App Nodes
  • LangSmith or LangFuse project for production traces
  • API gateway or auth layer if exposing public endpoints
  • Review of BisenseAI docs/product-document.md for platform terminology

Key Outcomes

  • Production BisenseFlow workflow for MCP core logic
  • Weaver UI bound to workflow inputs/outputs with loading and error states
  • Control-flow guards, retries, and structured JSON errors
  • Interactive playground regression fixtures before deploy
  • REST API deploy with rate limits and rotated keys
  • Optional MCP deploy for MCP tools/resources

Core Challenge

AI clients used to need bespoke integration code per host. MCP standardizes discovery, schemas, and lifecycle for tools and resources.

Your business logic should live once on BisenseFlow and expose to Claude Desktop, IDE agents, and your Weaver app via MCP and REST together.

Mutating actions must be tools; read-only RAG should be resources—mixing them confuses hosts and security reviews.

BisenseAI generates MCP manifests from deployed workflows—no hand-written TypeScript MCP SDK servers for standard patterns.

MCP spec 2025-11-25 unified remote agent tooling under JSON-RPC 2.0 with Streamable HTTP transport, OAuth 2.1 authorization, and standardized tool/resource/prompt manifests, replacing ad-hoc API glue every AI client previously required. BisenseAI deploys BisenseFlow workflows directly as MCP servers with auto-generated schemas, LangSmith trace correlation to JSON-RPC request IDs, and Weaver admin toggles for tool enablement per environment.

What You Will Build

A complete MCP application: Weaver-facing experience wired to BisenseFlow workflows that implement business logic with LLM, Agent, HTTP, Composio, and media nodes as needed.

Graphs are versioned, testable in the playground, and deployed without rewriting orchestration code per release.

Observability tags traces by tenant; optional marketplace packaging lets others fork your template.

Platform Architecture on BisenseAI

BisenseFlow is the source of truth for logic—nodes like LLM, Agent, Vector Store, Text Splitter, HTTP Request, Composio, Playwright, fal.ai, FFmpeg, and custom Python compose visually.

Weaver binds user actions to workflow I/O; real-time execution streams results; time-travel debugging inspects each node output.

Deploy the same workflows as REST APIs or MCP servers so web apps, mobile clients, and Claude Desktop share one runtime.

┌─────────────────┐
│ BisenseFlow     │
│ tool workflows  │──┐
│ resource RAG    │  │
└─────────────────┘  │
         │ Deploy MCP   │
         ▼              │
┌─────────────────┐     │
│ MCP Server      │◀────┘
│ stdio / SSE     │
└────────┬────────┘
         │
    Claude Desktop
    IDE agents
    Weaver (same graphs)

Visual logic on BisenseFlow

Drag-and-drop nodes implement MCP without boilerplate SDKs. Control-flow handles branches, loops, retries, and HITL interrupts.

Weaver product UI

App Nodes, forms, and AI-assisted I/O linking ship the user experience. Import React when you need a custom design system.

Playground and time-travel

Test every path before deploy. Replay runs node-by-node to fix schemas and prompts quickly.

Production deploy surfaces

REST and MCP deploy from project settings. Same graphs power UI, agents, and external clients. MCP deploy supports Streamable HTTP and OAuth 2.1 per spec 2025-11-25; manifest auto-generated from workflow Input schemas. Separate tool and resource registration toggles per workflow in deploy panel.

Backend Logic Canvas (BisenseFlow)

  • Build one BisenseFlow workflow per MCP tool with JSON inputs/outputs
  • Build read-only resource workflows (vector search → markdown snippets)
  • Playground until outputs are deterministic
  • Deploy as MCP Server: choose stdio or HTTP/SSE
  • Write tool descriptions for LLM routing in workflow metadata
  • Register resource URIs pointing to search workflows
  • API keys or OAuth at gateway for SSE deployments
  • Rate limits per MCP API key
  • LangSmith trace tool_name and resource_uri
  • Weaver admin toggles enable/disable tools
  • Health check workflow returns {status: ok}
  • Parallel REST deploy for non-MCP clients

Frontend Canvas (Weaver Studio)

  • App Nodes for primary user inputs
  • Toolbar or forms mapping to workflow ports
  • Loading and error Logic Nodes
  • Streaming bindings where LLM streams tokens
  • Results panel bound to JSON Output
  • Admin settings route (optional)
  • Playground embed for internal QA
  • Execution status from workflow runner
  • Time-travel debug link for support
  • AI-assisted linking for I/O setup
  • Environment-specific API base URLs
  • Deploy Weaver preview then production

Node Configuration Reference

Text Input

Define ports: user_text, action_enum, tenant_id.

Validate max length in Logic node before LLM calls.

LLM

System prompt specific to action; temperature 0.2–0.7.

Map CONTEXT variables from upstream retriever or state.

Agent

max_tool_calls 5–10; register tools with crisp descriptions.

Attach HTTP/Composio subgraphs as tools.

HTTP Request

Secrets in vault; timeout 30s; retry 429.

Return JSON serializable body to downstream nodes.

Logic

Route on enums; enforce guards (empty selection, unsafe hosts).

Emit structured errors for UI.

JSON Output

Single object for Weaver: result, citations, status, job_id.

Keep fields stable across versions.

Designing I/O contracts for MCP

Stable JSON Output fields prevent Weaver regressions. Version breaking changes with new workflow IDs or feature flags.

Document each port in project README; QA uses playground fixtures aligned to schema.

Observability and cost

Tag LangSmith traces with tenant_id, workflow, and action. Use cheap models for routing/enhancement; premium models for final output only.

Alert on error rate and p95 latency per node—bottlenecks often are HTTP tools not LLM.

JSON-RPC 2.0 Message Flow over Streamable HTTP

Clients POST JSON-RPC requests (tools/call, resources/read) to the MCP endpoint with Authorization header. Server streams JSON-RPC response objects as newline-delimited JSON or chunked HTTP body per 2025-11-25 spec. BisenseAI handles transport framing; your BisenseFlow workflow receives deserialized params on Input nodes.

Implement idempotency keys on mutating tools via a Logic node checking request_id cache in Redis or Vector Store metadata to prevent duplicate side effects when clients retry on timeout.

Manifest Generation and Version Pinning

MCP manifests list server name, version, tools[], resources[], prompts[] with inputSchema per entry. Auto-generate from BisenseFlow workflow Input node JSON Schema exports; manual override for descriptions in workflow metadata fields.

Pin manifest version in client configs; breaking inputSchema changes require manifest version bump and client update notification.

Latest Research & Industry Context (2025–2026)

MCP Specification 2025-11-25: Streamable HTTP and OAuth

The Model Context Protocol specification revision dated 2025-11-25 standardizes Streamable HTTP as the preferred remote transport, replacing earlier SSE-only patterns with bidirectional JSON-RPC 2.0 over HTTP with streaming response bodies. MCP servers advertise capabilities via a manifest endpoint listing tools, resources, and prompts with JSON Schema input definitions.

OAuth 2.1 authorization flows are now specified for remote MCP servers, enabling enterprise deployments where Claude Desktop, Cursor, and custom clients obtain scoped tokens before invoking tools. BisenseAI MCP deploy handles manifest generation from BisenseFlow workflow schemas and token validation at the transport layer.

The code execution pattern (tools that return code snippets for client-side sandbox execution rather than server-side side effects) reduces latency for read-only data transforms and aligns with Anthropic guidance on minimizing server round-trips for safe operations.

Sources: https://modelcontextprotocol.io/specification/2025-11-25 · Anthropic MCP documentation

MCP Tools vs Resources and JSON-RPC Error Handling

Separate tool workflows (mutating actions: create_record, send_email) from resource workflows (read-only context: get_document, search_index) in MCP manifests. Clients cache resource listings; tools require explicit invocation. BisenseFlow deploy panel exposes toggles per workflow for tool vs resource registration.

JSON-RPC error codes must map to structured messages; LangSmith traces on the BisenseFlow backend correlate MCP request IDs with internal workflow run IDs for support debugging.

Never expose admin mutating tools without HITL approval workflows on the BisenseFlow backend; enterprise MCP deployments require OAuth scopes per tool group.

MCP Security and Enterprise Deployment Patterns

Enterprise MCP deployments in 2025-2026 require OAuth scopes per tool, audit logging of every JSON-RPC call, IP allowlists for Streamable HTTP endpoints, and rate limiting per client_id.

Weaver admin UI toggles enable/disable individual MCP tools per environment (staging vs production). Manifest versioning prevents clients from calling deprecated tool schemas after workflow updates.

Test MCP servers with Claude Desktop and Cursor before customer rollout; validate token refresh, expired token handling, and Streamable HTTP reconnection after network interruption.

Sources: MCP security best practices · OAuth 2.1 RFC

Step-by-Step: Build in BisenseAI

  1. 1

    Create mcp-app BisenseFlow workflow

    New workflow `mcp-app-core` on BisenseFlow canvas.

    Add Input nodes; connect to first processing node.

  2. 2

    Configure primary LLM/Agent nodes

    Set prompts, temperature, max_tokens in node panels.

    Playground sample input; time-travel outputs.

  3. 3

    Add integrations

    Wire HTTP, Composio, fal.ai, FFmpeg, or Playwright as needed.

    Store credentials in BisenseAI secrets.

  4. 4

    Control-flow and errors

    Logic branches for validation; retry loops on 429/5xx.

    Structured JSON errors.

  5. 5

    JSON Output schema

    Define stable fields for Weaver.

    Document in README.

  6. 6

    Weaver UI

    App Nodes + I/O binding + AI-assisted linking.

    Loading/error states.

  7. 7

    Streaming (if applicable)

    Enable LLM stream mode; map to UI callback.

    Debounce rapid clicks.

  8. 8

    Playground regression

    Save 5–10 fixtures.

    Time-travel diff after changes.

  9. 9

    Observability

    LangSmith/LangFuse on.

    Review first 50 traces.

  10. 10

    Deploy REST API

    Deploy panel; gateway rate limits.

    Rotate keys.

  11. 11

    Optional MCP

    MCP Server deploy; Claude Desktop test.

    Separate tools vs resources.

  12. 12

    Production launch

    Complete productionChecklist.

    Monitor 24h error rate.

Production Checklist

  • Playground fixtures pass
  • Secrets not in exported graphs
  • Stable JSON Output schema
  • Rate limits configured
  • LangSmith/LangFuse enabled
  • Error branches tested
  • RBAC on Weaver routes
  • Retry policy on HTTP nodes
  • Deploy keys rotated
  • Runbook published
  • Cost alerts configured
  • MCP descriptions accurate (if used)

Common Pitfalls

Monolithic mega-prompt

Split per-action subgraphs on BisenseFlow for quality and cost.

Missing guards

Empty inputs should not call LLM—use Logic nodes.

Unstable JSON shape

Weaver breaks when Output fields rename—version carefully.

No traces

Enable LangSmith before launch—not after incidents.

Unbounded loops

Cap iterations and agent max_tool_calls.

Frequently Asked Questions

Streamable HTTP vs stdio: which MCP transport should I use?

Streamable HTTP for remote servers accessed by Claude Desktop, Cursor, and web clients across networks. stdio for local desktop apps spawning subprocess servers. BisenseAI MCP deploy defaults to Streamable HTTP with OAuth; stdio available for local development testing.

How do I map BisenseFlow workflows to MCP tools vs resources?

Tools for actions with side effects or computations (search, create, transform). Resources for static or slow-changing context (document templates, config snippets). Deploy panel checkboxes per workflow; manifest auto-lists enabled entries with descriptions from workflow metadata.

How does OAuth work with BisenseAI MCP servers?

BisenseAI acts as OAuth resource server; clients obtain tokens from your configured authorization server. Scopes map to tool groups (read_tools, write_tools). Test token refresh and expired token handling in Claude Desktop before customer rollout.

Can one MCP server expose multiple BisenseFlow workflows?

Yes. One MCP deploy target aggregates all enabled workflows in the project manifest. Each workflow becomes a separate tool or resource entry. Keep tool names globally unique within the server; prefix with domain (crm_search_contacts).

What is the MCP code execution pattern?

Tools return JavaScript or Python snippets for the client sandbox to execute locally on already-fetched data, avoiding server round-trips for safe transforms. Implement on BisenseFlow as a tool workflow that returns { code, language, input_schema } rather than executing compute server-side.

How do I debug MCP JSON-RPC failures?

Enable LangSmith on all MCP-backed workflows. Correlate JSON-RPC id from MCP logs with LangSmith trace run_id. BisenseFlow time-travel replay shows which node failed; return JSON-RPC -32603 with structured error.data pointing to error_code.

Ship MCP tools this week

Deploy workflows as MCP from the same canvas you already use.

Deploy MCP on BisenseAI