NASA API Integration with MCP

MCP Client

by jmand626

The MCP Project for CSE 473 Winter 2025. Coded with the assistance of Cursor AI and Claude 3.7

  • ide

About

NASA API Integration with MCP is a Python application that connects NASA’s public APIs to a Model Context Protocol (MCP) environment using Ollama and the llama3.2 language model. It lets users query NASA data through natural language, running as a command-line tool intended for developers and space enthusiasts.

How to use NASA API Integration with MCP?

First, install Ollama and the llama3.2 model. Then clone the repository, create a Python virtual environment (python -m venv venv), activate it (Windows: venv\Scripts\activate, Unix: source venv/bin/activate), and install dependencies with pip install -r requirements.txt. Run the main application with python mcp_chat.py. A test suite is available via python test_suite.py.

Key features of NASA API Integration with MCP

- Integrates NASA APIs with MCP via Ollama and llama3.2
- Supports natural‑language queries for space data
- Covers Astronomy Picture of the Day, Mars Rover photos, asteroids, Earth imagery
- Includes a dedicated test suite (test_suite.py)
- Straightforward command‑line interface (mcp_chat.py)

Use cases of NASA API Integration with MCP

- Retrieve today’s Astronomy Picture of the Day with explanation
- Request recent photos taken by the Curiosity rover on Mars
- Query near‑Earth asteroid data for current flybys
- Obtain satellite‑like images of Earth from space

FAQ from NASA API Integration with MCP

What do I need to install to get started?

You need Ollama with the llama3.2 model, a Python 3 virtual environment, and the dependencies listed in requirements.txt.

How do I launch the application?

After setting up the environment and dependencies, run python mcp_chat.py from the project root.

What example queries can I try?

The README provides examples: “Show me today's astronomy picture,” “What photos did Curiosity take recently?,” “Are there any asteroids passing near Earth?,” and “Show me images of Earth from space.”

Is there a way to verify the integration works?

Yes, you can run python test_suite.py to execute the project’s test suite.

Details

Author
jmand626
Category
ide
Website
ollama.ai/
Repository
jmand626/473-mcpproject

Quick Setup

1. Install Ollama and the llama3.2 model
2. Clone this repository
3. Create a virtual environment: python -m venv venv
4. Activate:
- Windows: venv\Scripts\activate
- Unix: source venv/bin/activate
5. Install dependencies: pip install -r requirements.txt

Running the Project

Run the main application:

python mcp_chat.py

Run the test suite:

python test_suite.py

Example Queries

- "Show me today's astronomy picture"
- "What photos did Curiosity take recently?"
- "Are there any asteroids passing near Earth?"
- "Show me images of Earth from space"

Project Documentation

See my report for more info