IntegrationsAI Agents

Building an AI Science Agent with MCP

Connect Claude or GPT to 30+ scientific computing tools using Model Context Protocol. Tutorial for building an AI agent that folds proteins, docks molecules, and screens compounds.

Ryan Bethencourt
April 4, 2026
10 min read

What Is the Model Context Protocol?

The Model Context Protocol (MCP) is an open standard created by Anthropic for connecting AI assistants to external tools and data sources. Think of it as USB-C for AI – a universal plug that lets any compatible AI agent discover and use any compatible tool server without custom integration code.

Before MCP, connecting an AI assistant to an external tool required writing glue code: defining function schemas, handling authentication, parsing responses, managing errors. Each tool needed its own integration. MCP standardizes all of this into a single protocol. The tool server describes what it can do, the AI client reads that description, and the two communicate through a well-defined message format.

For scientific computing, MCP is particularly powerful because science workflows are inherently multi-step. A researcher asking about a drug candidate might need protein structure prediction, binding pocket analysis, molecular docking, and ADMET profiling – four different computational tools chained together. MCP lets an AI agent orchestrate all of these without the researcher writing a single line of code.

Why Science Tools Need AI Agents

Computational biology and chemistry workflows have a structural problem: they are deeply sequential, require domain expertise to interpret intermediate results, and involve tools with wildly different interfaces, input formats, and output schemas. A typical drug discovery pipeline might look like this:

  • Step 1: Predict the 3D structure of a target protein from its amino acid sequence
  • Step 2: Identify binding pockets on the predicted structure
  • Step 3: Dock candidate small molecules into those pockets
  • Step 4: Calculate molecular properties and drug-likeness for top-scoring compounds
  • Step 5: Run ADMET predictions to flag toxicity or bioavailability issues

Each step requires a different tool, a different input format, and domain knowledge to decide whether the results warrant proceeding to the next step. A pLDDT score below 60 from protein folding might mean the structure is unreliable and docking results will be meaningless. A LogP above 5 might mean the compound will never be orally bioavailable regardless of binding affinity.

An AI agent with access to these tools can make these judgment calls. It understands the science well enough to interpret intermediate results, decide whether to proceed, and explain its reasoning to the researcher. This is not replacing the scientist – it is giving them a tireless, knowledgeable lab assistant that can run computations on demand.

Setting Up SciRouter's MCP Server

SciRouter runs a hosted MCP server at mcp.scirouter.ai/sse that exposes its full catalog of scientific computing tools. To connect Claude Desktop to this server, you need two things: a SciRouter API key and a one-time configuration change.

Step 1: Get Your API Key

Sign up at scirouter.ai/register to create a free account. Navigate to the API Keys section of your dashboard and generate a new key. The key starts with sk-sci- and is shown only once, so copy it immediately.

Step 2: Configure Claude Desktop

Open the Claude Desktop configuration file. On macOS, it lives at ~/Library/Application Support/Claude/claude_desktop_config.json. On Windows, look for %APPDATA%\Claude\claude_desktop_config.json. Add the SciRouter server entry:

claude_desktop_config.json
{
  "mcpServers": {
    "scirouter": {
      "url": "https://mcp.scirouter.ai/sse",
      "headers": {
        "Authorization": "Bearer sk-sci-your-api-key"
      }
    }
  }
}

Save the file and restart Claude Desktop. You should see a hammer icon in the chat input area. Click it to verify that SciRouter's tools appear in the list.

Tip
If you already have other MCP servers configured, just add the scirouter entry alongside them. Claude Desktop supports multiple MCP servers simultaneously, so your existing tools will continue to work.

Step 3: Verify the Connection

Open a new conversation and ask Claude what scientific tools it has access to. It should list the SciRouter tools it discovered, including ESMFold, DiffDock, Molecular Properties, and others. If the tools do not appear, double-check your API key and ensure there are no JSON syntax errors in the config file.

Verify tools are connected
You: What scientific computing tools do you have access to?

Claude: I have access to scientific computing tools through SciRouter:

- ESMFold — Predict protein 3D structure from amino acid sequence
- DiffDock — AI-powered molecular docking (ligand-protein)
- Molecular Properties — Calculate MW, LogP, TPSA, HBD, HBA from SMILES
- Molecule Similarity — Tanimoto fingerprint similarity between compounds
- Format Conversion — Convert between SMILES, InChI, and MOL formats
- ADMET Prediction — Absorption, distribution, metabolism, excretion, toxicity

Would you like me to use any of these tools?

Workflow 1: Analyze a Protein Sequence

Let's walk through a real multi-step workflow. You give Claude a protein sequence and ask it to analyze the structure. Behind the scenes, Claude will call ESMFold to predict the 3D structure, interpret the confidence scores, and annotate what the fold topology suggests about the protein's function.

Protein analysis workflow
You: Analyze this protein sequence and tell me about its structure:
MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTTKTYFPHFDLSH
GSAQVKGHGKKVADALTNAVAHVDDMPNALSALSDLHAHKLRVDPVNFKLL
SHCLLVTLAAHLPAEFTPAVHASLDKFLASVSTVLTSKYR

Claude: I'll fold this sequence using ESMFold and analyze the result.

[Calls ESMFold tool with the sequence]

Results:
- Mean pLDDT: 91.2 (very high confidence)
- The structure folds into a classic globin fold with 8 alpha helices
- This is human hemoglobin beta subunit (HBB)
- The high pLDDT indicates ESMFold is very confident in this prediction
- Key structural features:
  - Heme-binding pocket formed between helices E and F
  - Proximal histidine (His92) coordinates the iron center
  - The 2,3-BPG binding site is located in the central cavity

Would you like me to dock a small molecule into the heme-binding pocket
or calculate properties of any candidate compounds?

Notice how Claude does not just return raw numbers. It interprets the pLDDT score (91.2 is excellent), identifies the protein from its fold topology, and highlights biologically relevant features. This is the value of an AI agent – it combines computational results with domain knowledge.

Workflow 2: Is This Molecule a Good Drug Candidate?

Here is a more complex workflow. You give Claude a SMILES string for a compound and ask whether it could be a viable drug. The agent will calculate molecular properties, check drug-likeness rules, run ADMET predictions, and search for similar known drugs.

Drug candidate evaluation workflow
You: Is this molecule a good drug candidate?
Cc1ccc(-c2cc(C(F)(F)F)nn2-c2ccc(S(N)(=O)=O)cc2)cc1

Claude: I'll evaluate this compound step by step.

[Calls Molecular Properties tool]

Molecular Properties:
- Molecular Weight: 381.37 g/mol (under 500 ✓)
- LogP: 3.53 (under 5 ✓)
- H-Bond Donors: 1 (under 5 ✓)
- H-Bond Acceptors: 7 (under 10 ✓)
- TPSA: 86.19 Ų (good oral absorption range)
- Rotatable Bonds: 4 (good conformational flexibility)

Lipinski's Rule of Five: PASSES all criteria.

[Calls ADMET Prediction tool]

ADMET Profile:
- Absorption: High intestinal absorption predicted (93%)
- Distribution: Moderate plasma protein binding (87%)
- Metabolism: CYP2C9 substrate (monitor for drug interactions)
- Excretion: Predicted half-life 8-12 hours
- Toxicity: No structural alerts for hepatotoxicity

This is actually celecoxib (Celebrex), a marketed COX-2 selective
inhibitor. It has an excellent drug-likeness profile: all Lipinski
criteria are satisfied, TPSA is in the oral bioavailability sweet
spot, and the ADMET profile is favorable. The main clinical concern
is cardiovascular risk associated with COX-2 inhibitors as a class.
Note
The agent chains three tool calls (properties, ADMET, similarity) and synthesizes the results into a coherent assessment. Each tool call takes 1-5 seconds, and the agent handles all the orchestration automatically.

Workflow 3: End-to-End Structure-Based Drug Screening

The most powerful MCP workflow combines protein structure prediction with molecular docking. You provide a target protein and a set of candidate compounds, and the agent runs the full virtual screening pipeline.

Structure-based screening workflow
You: I have a kinase target with this sequence:
MENFQKVEKIGEGTYGVVYKARNKLTGEVVALKKIR...
Screen these three ATP-competitive inhibitor candidates:
1. c1ccc2c(c1)c(=O)c1ccccc1[nH]2 (acridone scaffold)
2. c1cnc2[nH]ccc2c1 (7-azaindole scaffold)
3. O=c1[nH]c(-c2ccccc2)nc2ccccc12 (quinazolinone scaffold)
Tell me which binds best.

Claude: I'll run a complete structure-based screen:

Step 1: Folding the kinase target...
[Calls ESMFold — takes ~15 seconds]
Structure predicted with mean pLDDT 84.7.

Step 2: Docking all three candidates...
[Calls DiffDock for each compound]

Results ranked by DiffDock confidence:
1. Quinazolinone scaffold — confidence 0.82, 3 poses found
2. 7-azaindole scaffold — confidence 0.71, 4 poses found
3. Acridone scaffold — confidence 0.58, 2 poses found

Step 3: Checking drug properties of the top hit...
[Calls Molecular Properties for quinazolinone]

The quinazolinone scaffold shows the strongest predicted binding
with good drug-like properties (MW 222, LogP 2.1). However, I'd
recommend testing all three experimentally — DiffDock confidence
scores correlate with but don't guarantee binding affinity.

Building Custom Agent Workflows with Python

While MCP provides a zero-code experience through Claude Desktop, you can also build programmatic agent workflows that use the same tools. This is useful when you need reproducible pipelines, batch processing, or integration with other systems.

Programmatic agent workflow using SciRouter API
import requests

API_KEY = "sk-sci-your-api-key"
BASE = "https://api.scirouter.ai/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}

def fold_and_dock_pipeline(protein_seq: str, ligand_smiles: list[str]):
    """Fold a protein, then dock multiple ligands against it."""

    # Step 1: Fold the protein
    fold_resp = requests.post(f"{BASE}/proteins/fold",
        headers=HEADERS,
        json={"sequence": protein_seq, "model": "esmfold"})
    job_id = fold_resp.json()["job_id"]

    # Poll until complete
    import time
    while True:
        result = requests.get(
            f"{BASE}/proteins/fold/{job_id}", headers=HEADERS
        ).json()
        if result["status"] == "completed":
            pdb_string = result["pdb"]
            print(f"Fold complete. pLDDT: {result['mean_plddt']:.1f}")
            break
        if result["status"] == "failed":
            raise RuntimeError(result["error"])
        time.sleep(3)

    # Step 2: Dock each ligand
    dock_results = []
    for smiles in ligand_smiles:
        resp = requests.post(f"{BASE}/docking/diffdock",
            headers=HEADERS,
            json={"ligand_smiles": smiles, "protein_pdb": pdb_string})
        dock_job = resp.json()["job_id"]

        while True:
            dock_result = requests.get(
                f"{BASE}/docking/{dock_job}", headers=HEADERS
            ).json()
            if dock_result["status"] == "completed":
                dock_results.append({
                    "smiles": smiles,
                    "confidence": dock_result["confidence"],
                    "num_poses": len(dock_result["poses"]),
                })
                break
            if dock_result["status"] == "failed":
                dock_results.append({
                    "smiles": smiles, "error": dock_result["error"]
                })
                break
            time.sleep(3)

    # Step 3: Rank by confidence
    ranked = sorted(dock_results, key=lambda x: x.get("confidence", 0),
                    reverse=True)
    for i, r in enumerate(ranked):
        print(f"{i+1}. {r['smiles'][:40]}... "
              f"confidence={r.get('confidence', 'N/A')}")
    return ranked

# Run the pipeline
results = fold_and_dock_pipeline(
    protein_seq="MVLSPADKTNVKAAWGKVGAHAGEYGAEALERMFLSFPTT...",
    ligand_smiles=[
        "CC(=O)Oc1ccccc1C(=O)O",           # aspirin
        "CC(C)Cc1ccc(C(C)C(=O)O)cc1",       # ibuprofen
        "Cc1ccc(-c2cc(C(F)(F)F)nn2-c2ccc(S(N)(=O)=O)cc2)cc1",  # celecoxib
    ]
)

MCP Architecture: How It Works Under the Hood

Understanding the MCP architecture helps you debug issues and build more sophisticated workflows. Here is how a typical tool call flows through the system:

  • Connection: Claude Desktop opens an SSE (Server-Sent Events) connection to mcp.scirouter.ai/sse
  • Discovery: The server sends a list of available tools with their names, descriptions, and JSON schemas for parameters
  • Invocation: When Claude decides to use a tool, it sends a JSON-RPC request with the tool name and arguments
  • Execution: The MCP server validates inputs, calls the underlying SciRouter API, and handles async job polling for GPU-intensive operations
  • Response: Results stream back to Claude through the SSE connection, and Claude interprets them for the user

The MCP server acts as a bridge between the AI assistant and SciRouter's compute infrastructure. It handles authentication (your API key), input validation (SMILES syntax, sequence format), and the async job lifecycle (submit, poll, retrieve) so the AI agent does not need to manage these details.

Warning
Long-running operations like protein folding (5–30 seconds) and molecular docking (10–60 seconds) are handled transparently by the MCP server. Claude will appear to pause while waiting for results. If a job exceeds the 120-second timeout, the server returns a timeout error and Claude will inform you.

Security Considerations

When giving an AI agent access to computational tools, security matters. Here is how SciRouter's MCP implementation handles the key concerns:

  • Authentication: Every tool call requires a valid API key. The key is stored locally and sent over HTTPS
  • Input validation: The MCP server validates all inputs before forwarding to compute workers. Malformed SMILES, invalid sequences, and oversized inputs are rejected
  • Rate limiting: Your account's rate limits apply to MCP calls just as they do to direct API calls
  • Read-only by default: SciRouter tools are computational – they predict structures and calculate properties. They do not modify data, send emails, or perform any destructive operations
  • No data persistence: Input sequences and molecules are processed and discarded. SciRouter does not store your research data beyond the cache duration needed for result retrieval

Next Steps

You now have a fully configured AI science agent that can fold proteins, dock molecules, calculate properties, and screen compounds – all through natural conversation. Here are some directions to explore:

  • Try the ESMFold tool with your own protein sequences
  • Use DiffDock to dock drug candidates against predicted structures
  • Screen compound libraries with Molecular Properties to filter by drug-likeness

For programmatic agent workflows with more control over orchestration, see our guide on using SciRouter with LangChain for AI drug discovery. For a deeper dive on molecular descriptors and what they mean, check out calculating molecular properties from SMILES.

Ready to build your own AI science agent? Get your free API key and connect to Claude in under two minutes.

Frequently Asked Questions

What is MCP and how is it different from a regular API?

MCP (Model Context Protocol) is an open standard for connecting AI assistants to external tools. Unlike a regular API where you write code to make HTTP requests, MCP lets AI agents like Claude automatically discover available tools, understand their parameters, and call them during a conversation. You configure the server once and the agent handles everything else.

Which AI assistants support MCP?

Claude Desktop has native MCP support. The protocol is open, so any client that implements the MCP specification can connect. Several open-source projects including Cursor, Windsurf, and community clients also support MCP. OpenAI's ChatGPT does not currently support MCP natively, but you can use SciRouter's REST API or Python SDK with GPT-based agents via LangChain.

Is my API key secure when using MCP?

Yes. Your SciRouter API key is stored in the local MCP configuration file on your machine. It is sent directly from the MCP client to SciRouter's API servers over HTTPS. The key is never shared with the AI model provider (e.g., Anthropic). Treat the config file like any credential file and do not commit it to version control.

Can the AI agent run multi-step workflows autonomously?

Yes. That is the core value of combining MCP with an AI agent. The agent can chain tool calls — for example, folding a protein, then docking a ligand against the result, then checking ADMET properties of the ligand. Each step's output informs the next. The agent decides the workflow based on your natural language request.

What are the rate limits for MCP tool calls?

MCP tool calls count against the same rate limits as direct API calls. The free tier includes 500 credits per month. A protein fold costs 5 credits, molecular docking costs 10 credits, and property calculations cost 1 credit. A typical multi-step workflow uses 15-25 credits depending on complexity.

Can I use MCP with my own local models?

SciRouter's MCP server connects to SciRouter's hosted infrastructure, not local models. However, MCP is composable — you can run multiple MCP servers simultaneously. If you have local tools exposed via their own MCP server, your AI agent can use both SciRouter's cloud tools and your local tools in the same conversation.

Try this yourself

500 free credits. No credit card required.