HistoryMCP
Allows reading and analyzing Firefox browsing history, returning the last 100 visited URLs and page titles.
Allows reading and analyzing Safari browsing history, returning the last 100 visited URLs and page titles.
Provides access to browser history data stored in SQLite databases, enabling retrieval of visited URLs and page titles.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@HistoryMCPshow me the last 10 pages I visited"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
HistoryMCP
A Model Context Protocol (MCP) tool that provides access to browser history data from SQLite databases. This tool allows AI assistants to read and analyze your browsing history through the MCP interface.
Features
Browser History Access: Read the last 100 visited URLs from your browser's SQLite history database
MCP Integration: Seamlessly integrates with MCP-compatible AI assistants
Cross-Platform: Works with any browser that stores history in SQLite format (Chrome, Firefox, Safari, etc.)
Related MCP server: Search History MCP Server
Installation
Prerequisites
Python 3.12 or higher
A browser history SQLite database file
Setup
Clone or download this repository
Install dependencies using uv (recommended):
uv syncSet up your browser history database path:
You need to set the
SQLITE_PATHenvironment variable to point to your browser's history database:Chrome/Chromium:
export SQLITE_PATH="$HOME/Library/Application Support/Google/Chrome/Default/History"Firefox:
export SQLITE_PATH="$HOME/Library/Application Support/Firefox/Profiles/*.default/places.sqlite"Safari:
export SQLITE_PATH="$HOME/Library/Safari/History.db"Note: You may need to copy the database file to a writable location first, as browsers often lock their database files.
Usage
Running the MCP Server
python main.pyThe server runs on stdio transport, which is the standard for MCP tools.
Available Tools
read_history()
Returns the last 100 visited URLs from your browser history.
Returns:
List[Dict[str, str]]: A list of dictionaries containing:"title": The title of the web page"url": The URL of the web page
Example Response:
[
{
"title": "GitHub - Homepage",
"url": "https://github.com"
},
{
"title": "Stack Overflow - Programming Questions",
"url": "https://stackoverflow.com"
}
]Integration with MCP Clients
To use this tool with an MCP client, add it to your MCP configuration:
{
"mcpServers": {
"history": {
"command": "python",
"args": ["/path/to/historyMCP/main.py"],
"env": {
"SQLITE_PATH": "/path/to/your/browser/history.db"
}
}
}
}Development
Project Structure
historyMCP/
├── main.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── README.md # This file
└── uv.lock # Dependency lock fileDependencies
mcp[cli]>=1.10.1: Model Context Protocol implementationrequests>=2.32.4: HTTP requests for web content fetchinghttpx>=0.28.1: Modern HTTP clientpandas>=2.3.0: Data manipulation (for future features)
Adding New Features
The codebase is structured to easily add new tools. To add a new MCP tool:
Create a new function with the
@mcp.tool()decoratorDefine the function signature and return type
Add appropriate documentation
Example:
@mcp.tool()
def search_history(query: str) -> List[Dict[str, str]]:
"""
Search browser history for URLs containing the query
Args:
query: Search term to look for in URLs and titles
Returns:
List of matching history entries
"""
# Implementation here
passSecurity Considerations
⚠️ Important: This tool accesses your browser history, which may contain sensitive information. Consider the following:
Only use this tool with trusted MCP clients
Be aware that your browsing history will be shared with AI assistants
Consider using a separate browser profile for testing
Review the data being shared before using in production environments
Troubleshooting
Common Issues
"Please set the SQLITE_PATH environment variable"
Make sure you've set the
SQLITE_PATHenvironment variable correctlyVerify the path points to a valid SQLite database file
"Database is locked"
Close your browser completely
Copy the database file to a temporary location
Update the
SQLITE_PATHto point to the copied file
"No such file or directory"
Check that the browser history database path is correct for your system
Ensure the file exists and is readable
Getting Help
If you encounter issues:
Check that your Python version is 3.12 or higher
Verify all dependencies are installed correctly
Ensure the SQLite database path is correct and accessible
Check that your browser is not currently running (to avoid database locks)
License
This project is open source. Please check the license file for more details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request or open an issue for bugs and feature requests.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jovillios/historyMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server