# Using MCP Project Memory with NPX

This guide explains how to use the Project Memory MCP Server via NPX without needing to install it globally or clone the repository.

## Basic Usage

### Starting the Server

```bash
npx mcp-project-memory start
```

This will:
1. Download the package if not already cached
2. Start the server with default settings
3. Create a memory.json file in the current directory if it doesn't exist

### Using a Custom Memory File

You can specify a custom memory file path:

```bash
npx mcp-project-memory start path/to/memory.json
```

### Running as a Background Process

To run the server as a daemon (background process):

```bash
npx mcp-project-memory daemon
```

This will:
1. Start the server in background mode
2. Create log files in the logs/ directory
3. Output the process ID for reference

## Command Line Options

```bash
npx mcp-project-memory help
```

Displays the help text with all available commands and options.

```bash
npx mcp-project-memory version
```

Displays the version information.

## Integration with AI Platforms

### Claude Desktop

Add this to your Claude Desktop launch configuration:

```json
{
  "mcp": {
    "memory": {
      "command": "npx mcp-project-memory start"
    }
  }
}
```

### LibreChat

Add this to your librechat.yaml configuration:

```yaml
mcpServers:
  project-memory:
    type: stdio
    command: npx
    args:
      - mcp-project-memory
      - start
    env:
      # Optional: Specify a custom memory file path
      # MEMORY_FILE_PATH: path/to/your/memory.json
```

See [librechat.md](librechat.md) for more detailed LibreChat integration instructions.

## Multiple Projects

To manage multiple projects, use different memory files:

```bash
# Project 1
npx mcp-project-memory start project1-memory.json

# Project 2
npx mcp-project-memory start project2-memory.json
```

## Troubleshooting

### Common Issues

1. **Permission Denied**: If you encounter permission errors, try running with sudo or fixing permissions on the memory file directory.

2. **Port Already in Use**: If using HTTP mode and encountering port conflicts, specify a different port:
   ```bash
   PORT=3457 npx mcp-project-memory start
   ```

3. **Node.js Version**: This package requires Node.js 14.0.0 or higher. Update your Node.js installation if needed.

### Logs

When running in daemon mode, logs are stored in:
- Standard output: `logs/server-[timestamp].log`
- Error output: `logs/server-error-[timestamp].log`