To install the atlas-mcp-server, you have two options: using npm or manually from source.
Using npm (recommended):
bash
npm i atlas-mcp-server
Manually from source:
Clone the repository:
bash
git clone https://github.com/cyanheads/atlas-mcp-server.git
cd atlas-mcp-server
Install dependencies:
bash
npm install
Build the project:
bash
npm run build
After installation, you'll need to configure your MCP client to use the server. See the "Configuration" section in the README for details.
User
if I had already installed but the repo was updated, how can I update?
Assistant
To update the atlas-mcp-server after it has been updated in the repository, you should follow these steps based on your initial installation method:
User
error: The following untracked working tree files would be overwritten by merge:
package-lock.json
Please move or remove them before you merge.
Aborting
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Navigate to your project directory: Open your terminal and navigate to the root directory of your project where atlas-mcp-server is installed.
Update the package: Run the following command to update atlas-mcp-server to the latest version:
bash
npm update atlas-mcp-server
This command will fetch the latest version and update the dependency in your node_modules directory.
Restart your server: Ensure you stop any running instances of the server and restart to ensure changes are picked up.
If you installed manually from source:
Navigate to the repository directory: Open your terminal and navigate to the root directory of your cloned atlas-mcp-server repository.
Pull the latest changes: Fetch and merge the latest changes from the remote repository:
bash
git pull origin main
or
bash
git pull origin master
(depending on the branch you are using)
Reinstall dependencies (if needed): If the package.json file was updated (new dependencies added, versions changed), you should run:
bash
npm install
Rebuild the project:
bash
npm run build
This will recompile the TypeScript code and update the build files.
Restart your server: Ensure you stop any running instances of the server and restart to ensure changes are picked up.
Important Considerations:
Check Release Notes: After updating, it's good practice to check the release notes or changelog (if available) for any breaking changes or specific instructions for the new version.
Configuration: If the update includes changes to configuration options, you may need to adjust your settings according to the documentation.
Backup: Before any update process, consider backing up your current setup if you are concerned about potential issues. This may include backing up the database or configuration files.
npm update vs. npm install: npm update will update the package to the latest version within the range specified in your package.json. If you have a very old version, or need to update a major version, you may need to manually update the version in package.json and run npm install.
By following the appropriate steps based on your installation method, you can successfully update your atlas-mcp-server to the latest version.
Okay, the error message you're seeing indicates that Git is preventing you from pulling changes because you have local, uncommitted changes in your working directory that would be overwritten by the incoming changes from the git pull command. Specifically, it's flagging package-lock.json as a problem.
Here's a breakdown of what's happening and how to resolve it:
Understanding the Error
package-lock.json: This file is automatically generated by npm (or yarn) when you install or update packages. It records the exact versions of all your dependencies to ensure consistent installations across different environments.
Untracked Working Tree Files: Git tracks changes to files that it knows about. If you create a new file, or modify a file that Git doesn't know about, it's considered "untracked". In this case, Git sees that you may have modified package-lock.json, even if the modifications are accidental.
Overwrite Prevention: Git is preventing the pull operation because it doesn't want to overwrite your local, untracked changes, as that might lead to lost work.
How to Fix the Error
You have several ways to resolve this. Here are the most common solutions, ordered from safest to more forceful:
Stash Your Changes (Recommended for temporary changes)
This is the safest and most flexible approach. It temporarily saves your changes, allowing you to pull, and then reapply them.
bash
git stash push -m "Stashing package-lock changes"
git pull origin main # or git pull origin master
git stash pop
git stash push -m "message" saves changes to a "stash" with a helpful message.
git pull origin main (or git pull origin master) fetches and merges the remote changes
git stash pop reapplies the changes you stashed. If there are conflicts, it will let you know, and you will have to resolve them manually.
Commit Your Changes (If you intend to keep them)
If the changes to package-lock.json are intentional, you should commit them:
bash
git add package-lock.json
git commit -m "Updated package-lock.json"
git pull origin main # or git pull origin master
git add stages the package-lock.json file for commit.
git commit records the changes with a commit message.
After committing the changes, the pull operation should succeed.
Remove Your Changes (If you don't need them)
If you accidentally modified package-lock.json and don't want to keep the changes, you can remove them.
Caution: This is data loss if the changes were intentional.
You can either delete the file and rebuild, or use git:
bash
git checkout -- package-lock.json # use if you modified the file
# or
rm package-lock.json # use if you just have an extra file
npm install # reinstall dependencies to generate a new package-lock.json
git pull origin main # or git pull origin master
git checkout -- package-lock.json discards local modifications to the file and resets it to the version from your last commit.
rm package-lock.json deletes the file from your working directory.
npm install will regenerate package-lock.json with the project's current dependencies.
Which Solution Should You Use?
Stashing is usually the safest option if you just want to temporarily set aside your changes, pull the updates, and then reapply them.
Committing is best if you intend to keep the changes you made to package-lock.json or other tracked files.
Removing should only be used when you're sure you don't need the changes you made to package-lock.json and did not intentionally make them.
Important Notes:
package-lock.json: In general, you should avoid making manual edits to package-lock.json file, as they are often auto-generated.
Understanding Git: Familiarize yourself with Git basics (staging, committing, branching, pulling, etc.) to efficiently manage your projects.
Example using Stashing:
Let's use the stashing method:
bash
git stash push -m "Stashing package-lock changes"
git pull origin main
git stash pop
After running these commands, if there are conflicts, they will be flagged, and you can resolve them manually. Otherwise, the git pull should succeed, and you'll have the latest updates from the repository.
Remember to choose the option that best fits your situation and to understand the implications of each choice.